[Archived from my old blog]
Saturday, October 16, 2010
A couple years ago I was downloading a few mame roms from a site called dohgames, I wasn’t happy with the the download system in place, it meant too much waiting and clicking just to get a single rom. So I dissembled the site, and wrote a script to download the games much faster.
It’s sloppy and could be cleaned up a bit, but it worked and was all I really needed.
As usual I began by deconstruction of the url;
The website the files were hosted on.
The Directory where the files were stored.
The php script that managed the downloads.
Open in Notepad or another text editor to see how it works, and what files & directories it calls to.
The id of the Rom I was downloading.
The System of the Rom I was downloading, in this case Mame.
I then did a few simple tests to findout just how many id’s were in the data base.
In this case I found that an id of 1 – 5169 worked.
A quick wget string will fetch the file:
wget -nd -p -np -t2 -k -a default.log -nv -A.zip,.exe,.rar,*mame* “http://www.dohgames.com/roms/download.php?id=5169&sys=mame”
Now to download them all just use a variable in place of the url and have a list of all urls you want to download contained within a text file.
dohgames.com has sadly closed it doors after 6 years of service, but the same method used in this post can be applied to other sites.
I’ve used it successfully on a few sites, though some more complex then others due to security measures in place.