在花了大约一个小时从 sourceforge 下载几乎每个 Msys 包后,我想知道是否有更聪明的方法来做到这一点。是否可以为此目的使用 wget ?
问问题
3697 次
2 回答
4
我已经成功使用了这个脚本:
https://github.com/SpiritQuaddicted/sourceforge-file-download
供您使用:
sourceforge-file-downloader.sh msys
它应该首先下载所有页面,然后在页面中找到实际链接并下载最终文件。
从项目描述:
允许您下载所有 sourceforge 项目的文件。下载到当前目录到一个名为项目的目录中。将项目名称作为第一个参数传递,例如 ./sourceforge-file-download.sh inkscape 以下载所有http://sourceforge.net/projects/inkscape/files/
以防回购被删除,因为它足够短,所以我会在这里发布:
#!/bin/sh
project=$1
echo "Downloading $project's files"
# download all the pages on which direct download links are
# be nice, sleep a second
wget -w 1 -np -m -A download http://sourceforge.net/projects/$project/files/
# extract those links
grep -Rh direct-download sourceforge.net/ | grep -Eo '".*" ' | sed 's/"//g' > urllist
# remove temporary files, unless you want to keep them for some reason
rm -r sourceforge.net/
# download each of the extracted URLs, put into $projectname/
while read url; do wget --content-disposition -x -nH --cut-dirs=1 "${url}"; done < urllist
rm urllist
于 2017-07-06T02:40:06.180 回答