花了大约一个小时从sourceforge下载几乎每个Msys包后,我想知道是否有更聪明的方法来做到这一点。为此可以使用wget吗?
答案 0 :(得分:2)
我已成功使用此脚本:
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
答案 1 :(得分:0)