New Lolipower download script

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

, ,

  1. #1 by Annika Szopinski on January 7, 2010 - 12:14 am

    Thank you. Very interesting posting.

  2. #2 by I don't know perl on May 3, 2010 - 6:24 pm

    It seems to fail on the title “Tetsuya”, probably because of “glossary.txt” file which has no md5

    Download Shoubushi Densetsu Tetsuya – 1 – Magician of the Tiles.avi
    Using temporary file OjMpjX3ni7
    ** GET http://nobue.lolipower.org/download2.php?encrypt=CUT, ==> 200 OK (238s)
    Checking md5 1E9697DAE2A6281284E001D4E2962CFE == 6AF50D46FD897BD20938891ED8419D19
    Shoubushi Densetsu Tetsuya – 1 – Magician of the Tiles.avi is damaged
    grace time of 10
    parsed episode The Law of Bainin number 2

    • #3 by Dario Meloni on May 4, 2010 - 8:11 am

      It is not a problem of glossary.txt (since it has no md5 it is just skipped), the downloaded file checksum mismatches the checksum specified on lolipower, so the file is to be considered damaged,incomplete or whater could have happened during the transfert. Try downloading it by hand and check the checksum yourself, maybe lolipower has a wrong md5 specified on the page

  3. #4 by Shiki on September 13, 2010 - 8:43 am

    Um, hi. I just downloaded this and installed Strawberry Perl to get it running. I had to install the WWW-Mechanize, TreeBuilder and XPathEngine components to get it running, but I was finally able to at least have the Help text show up.

    However, whenever I try to actually download anything (in this specific case, I’m trying to get Kampfer), this comes up in my console:

    Can't locate object method "new_from_content" via package "HTML::TreeBuilder::XPath" at lolipower.plx line 148.

    Only thing I can think of for this crash is that I may have an outdated or overly updated version of the TreeBuilder component. I’m running version 0.11 of the XPath.pm file. Is yours newer or older? If older, can you please upload it somewhere so I can replace mine with the older one and actually be able to enjoy your script?

    Thanks very much in advance. =3

    • #5 by Dario Meloni on September 13, 2010 - 10:34 am

      I am using the same versions!

      HTML::TreeBuilder::XPath 0.11
      XML::XPathEngine 0.12 (dependency of TreeBuilder)
      WWW::Mechanize 1.54

      Maybe it’s better having a linux virtual machine tu run this software and saving the data to a shared folder with the host system. I can’t be of much help on Windows * systems as i never had one

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.