Archive for December, 2009
New Lolipower download script
Posted by Dario Meloni in perl, Posts, Script on December 6, 2009
And this time it’s in perl!
I rewrote the script from scratch to see how much i knew Perl, and this is what I worked out.
It’s base on WWW::Mechanize and HTML::TreeBuilder::XPath respectively for managing the cookies and for searching in the html tree.
Using it is fairly simple.
lolipower Title
and it will download all the episodes of the anime in the local folder.
With respect to the ruby version you can find in these pages the title can be partial, the script will find the complete title. If the title matches more then one anime then a list of anime that maches will be printed and the download aborted.
There are various options, especially 2 that I added to put the script in a cronjob to get mailed when a new episode comes out and automatically download it at night time.
lolipower --dest TitleFolder --new-ep Title
The --dest options tells the script where to save the files instead of the current directory, while --new-ep suppress every output except for new downloaded episodes, and will write in the mail even if the anime is completed.
One another nice feature is that it doesn’t check anymore each file’s md5 hash but only for freshly downloaded files. The behavior can be hoverwer forced with the --md5 flag.
Aside from the options --starep and --endep that do exactly what you can think of there is the --search command. It will search the title in the list of animes without downloading anything.
There is another cute option to allow serial download of more then one anime! The --conf option.
It accepts file with # as comment line and structured like
# comment line
Title=Folder
Title=Folder
where Title is the anime title (or a match for a unique anime) and Folder is a absolute path to the location where to store the episodes.
And from version 1.1 there is support for out of order episodes on the website, –startep and –endep works a lot better and the pages on the server are loaded less times.
The script can be found here