I am trying to write a script that searches for specific MIME types on a website containing download links (.mp3, .avi, .mpeg) and want to be able to crawl that site and then download any files stored there. The pseudocode for this script:
Input URL
function search ()
{
Search URL for matching MIME types and download to dir on my pc
}
Okay, that was really bad, but I am still learning. Would a Perl script be best for this?
Take a look at the
wgetcommand. Here is an example command which will search a site recursively for all mp3, avi and mpeg files and save them into the current directory:This is what the options mean:
You can also add other options for recursion depth, timeouts etc. See
man wgetfor more information.