0

Have a pile of 50 .rar files on a web server and I want to download them all. And, the names of the files have nothing in common other than .rar.

I wanted to try aria2 to download all of them altogether, but I think I need to write a script to fetch the addresses of all the .rar files.

I have no idea how to start writing the scrip. Any hint will be appreciated.

user2326844
  • 321
  • 2
  • 8
  • 20

1 Answers1

0

You can try to play with wget with -A parameter in your shell script:

wget -r "https://foo/" -P /tmp -A "*.rar"

Here is an explanation of what -A does

Specify comma-separated lists of file name suffixes or patterns to accept or reject (see Types of Files). Note that if any of the wildcard characters, ‘’, ‘?’, ‘[’ or ‘]’, appear in an element of acclist or rejlist, it will be treated as a pattern, rather than a suffix. In this case, you have to enclose the pattern into quotes to prevent your shell from expanding it, like in ‘-A ".mp3"’ or ‘-A '*.mp3'’.

Stanley Kirdey
  • 602
  • 5
  • 20