Download all files of certain extension from website using wget

Alec Jacobson

May 17, 2010

weblog/

Issue this command in a terminal to download all mp3s linked to on a page using wget

wget -r -l1 -H -t1 -nd -N -np -A.mp3 -erobots=off [url of website]

OR if you want to download all linked mp3s from multiple pages then make a text file containing each url on a separate line, then issue:

wget -r -l1 -H -t1 -nd -N -np -A.mp3 -erobots=off -i ~/mp3blogs.txt

If the site is behind basic http authentication you can use something like:

wget --http-user [username] --http-passwd [passwd] -r -l1 -H -t1 -nd -N -np -A.mp3 -erobots=off "[url]"