Ubuntu – Aria2 download from FTP from a list of URL

ftpserverwget

I'm currently using the following wget command to download from an FTP server from a list of URL's in a file:

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

But now I need a way to simultaneously download multiple files at the same time. I'm trying to use aria2 for this and I tried the following command:

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

But I can't seem to find a way to get aria2 to login first to the FTP.

So my question is, is there a command for aria2 to login first to the FTP server and then download from the list of URL's?

Alternatively is there a better tool better suited to my task?

Thanks

Best Answer

From 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@

So you can use something like this

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

Another way may be gnu parallel(check man parallel for more details):

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