如何从特定的Sourceforge项目下载所有文件?

FFo*_*Fox 6 sourceforge wget msys

花了大约一个小时从sourceforge下载几乎每个Msys包后,我想知道是否有更聪明的方法来做到这一点.为此可以使用wget吗?

0x7*_*x78 8

我已经成功地使用了这个脚本:

https://github.com/SpiritQuaddicted/sourceforge-file-download

供您使用运行:

sourceforge-file-downloader.sh msys 
Run Code Online (Sandbox Code Playgroud)

它应该首先下载所有页面,然后找到页面中的实际链接并下载最终文件。

从项目描述来看:

允许您下载 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
Run Code Online (Sandbox Code Playgroud)