0

I would like to download all mp3 files from a website using wget. But the website is having pages that end with .aspx extension. I tried the following

wget -r -c -nd -l1 --no-parent -A mp3 http://ww2.example.com/audio.aspx

It produced

audio.aspx   100%[===================>] 141.01K   105KB/s    in 1.3s
Removing audio.aspx since it should be rejected.

I have also tried

wget -r -c -nd -l1 --no-parent -A mp3,aspx http://ww2.example.com/audio.aspx

but that downloaded only aspx files and didn't download mp3 files.

The audio.aspx file doesn't itself contain direct links to any mp3s but it will contain links to other aspx pages which contain links to the mp3 files that i want to download.

I want to download mp3 files from http://ww2.example.org/* (i.e. from whole website).

P.S: The aspx files here are static and are not dynamic web pages but are somehow named with aspx extension.

Edit: Even after trying the solution as stated in the comment, I got the same output. I think wget is somehow not able to identify the mp3 files in them.

JavaTechnical
  • 8,846
  • 8
  • 61
  • 97
  • Possible duplicate of [How to download all files (but not HTML) from a website using wget?](https://stackoverflow.com/questions/8755229/how-to-download-all-files-but-not-html-from-a-website-using-wget) – José Luis Oct 25 '17 at 10:54
  • @JoséLuis I tried that answer but the audio.aspx is downloaded as audio.aspx.html and it is rejected – JavaTechnical Oct 25 '17 at 11:00

1 Answers1

0

Try removing -A mp3,aspx and add -p to download page requisites. Let wget download everything and then use find . -type f ! -iname "*.mp3" -delete to remove all non-mp3 files.

Bold Warrior
  • 5
  • 1
  • 5