从 URL 列表中通过 FTP 下载 Aria2

从 URL 列表中通过 FTP 下载 Aria2

我目前正在使用以下 wget 命令从 FTP 服务器中的文件中的 URL 列表下载:

wget --user=mylogin --password='mypassword' -P /home/ftp/ -i /var/www/file/url.txt -N

但现在我需要一种方法来同时下载多个文件。我尝试使用 aria2 来实现这一点,并尝试了以下命令:

aria2c -x 5 -i /var/www/file/url.txt

但我似乎找不到让 aria2 首先登录 FTP 的方法。

所以我的问题是,是否有一个命令让 aria2 先登录到 FTP 服务器,然后从 URL 列表中下载?

或者有没有更适合我的任务的更好的工具?

谢谢

答案1

man aria2c

--ftp-user=<USER>
      Set FTP user. This affects all URIs.  Default: anonymous

--ftp-passwd=<PASSWD>
      Set FTP password. This affects all URIs.  If user name is embedded  but  pass‐
      word is missing in URI, aria2 tries to resolve password using .netrc. If pass‐
      word is found in .netrc, then use it as password. If  not,  use  the  password
      specified in this option.  Default: ARIA2USER@

所以你可以使用类似这样的东西

aria2c -j5 --ftp-user=yourname --ftp-passwd=password --input-file=list.txt 

另一种方法可能是gnu parallel(查看man parallel更多详细信息):

cat list.txt | parallel -j5 wget --user=mylogin --password=mypassword -P /home/ftp

相关内容