Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use wget to download all mp3 files linked to from a list of input URLs, but residing on an external host. The input URLs are contained in the file input.txt Each URL listed in input.txt leads to an index.html which has several links on a local host (which I don't care about), as well as a link to (which I am trying to download). The same external server is used for all the mp3 files I am interested in. I've tried:

wget -r -l1 -H -A *.mp3 -i input.txt

but this results in all index.html files being rejected, and therefore they're not followed either. The next attempt:

wget -r -l1 -H -A *.mp3,*.html -i input.txt

gets all the index.html files, but does not get any of the linked mp3 files from the external server.

The next attempt:

wget -r -l1 -H -A *.mp3,*.html -i input.txt

gives the same result as the previous attempt. As well as using -l2 for depth.

share|improve this question
wget -r -l1 -H -A *.mp3,*.html -i input.txt seems to work as expected. I may be able to help, if you provide a concrete example where it fails. – S Prasanth Dec 11 '12 at 13:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.