How can I download all MP3 files from a web site?

I am wondering if there is any software available in OS X that can download all mp3s or specific type of file from a URL. For e.g. I have a url http://www.parweztv.com/Khan%20Adeeb/SURA-04/ and I want to grab all mp3 from this url instead of right clicking one by one and saving it.

Also wondering, if that can be done using wget or some terminal command in OS X?


Solution 1:

You can use wget like this:

wget -r -nd -A.mp3 http://www.parweztv.com/Khan%20Adeeb/SURA-04/

-r to recursively download all files below the level of the URL specified

-nd to not create a hierarchy of directories in your download location (not necessary)

-A to specify the files you want to download (all files ending in .mp3 in your case)

You can obtain wget for OSX via homebrew or macports.

Solution 2:

My recommendation would be SiteSucker. It's a great (free) application! It will allow you to download folders from a site. So, just enter in your URL and click "Download"

sitesucker image

SiteSucker is a Macintosh application that automatically downloads Web sites from the Internet. It does this by asynchronously copying the site's Web pages, images, backgrounds, movies, and other files to your local hard drive, duplicating the site's directory structure. Just enter a URL (Uniform Resource Locator), press return, and SiteSucker can download an entire Web site.

Solution 3:

You can write a script for that (preferably in PHP or python, or any other scripting language which has bindings to libxml). but I'm not aware of any solutions that use curl or wget only.

However, there exist GUI level programs for batch downloading. One example is the DownThemAll! Add-On for Firefox.