在花了大约一个小时从 sourceforge 下载几乎每个 Msys 包之后,我想知道是否有更聪明的方法来做到这一点。是否可以使用 wget 来实现此目的?
我已经成功地使用了这个脚本:
https://github.com/SpiritQuaddicted/sourceforge-file-download https://github.com/SpiritQuaddicted/sourceforge-file-download
供您使用运行:
sourceforge-file-downloader.sh msys
它应该首先下载所有页面,然后找到页面中的实际链接并下载最终文件。
从项目描述来看:
允许您下载 sourceforge 项目的所有文件。下载到当前目录到与项目名称相同的目录中。将项目名称作为第一个参数传递,例如 ./sourceforge-file-download.sh inkscape 下载所有项目http://sourceforge.net/projects/inkscape/files/ 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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)