From 382c4c05add6ac909bb4077600c58019dc24a359 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 25 Apr 2013 21:20:48 +0200 Subject: [PATCH] Added TheDreamlandChronicles --- doc/changelog.txt | 2 +- dosagelib/plugins/t.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/doc/changelog.txt b/doc/changelog.txt index e096fc73f..42f13759d 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -2,7 +2,7 @@ Dosage 2.2 (released xx.xx.2013) Features: - comic: Added ARedTailsDream, Carciphona, Curtailed, GirlGenius, - Lackadaisy, SabrinaOnline. + Lackadaisy, SabrinaOnline, TheDreamlandChronicles. Patch by Dirk Reiners Changes: diff --git a/dosagelib/plugins/t.py b/dosagelib/plugins/t.py index 1f2e730e8..9adcfe36c 100644 --- a/dosagelib/plugins/t.py +++ b/dosagelib/plugins/t.py @@ -29,6 +29,27 @@ class TheDevilsPanties(_BasicScraper): help = 'Index format: number' +class TheDreamlandChronicles(_BasicScraper): + description = u'The Dreamland Chronicles' + url = 'http://www.thedreamlandchronicles.com/' + stripUrl = url + 'comic/%s/' + firstStripUrl = stripUrl % 'page-1' + rurl = escape(url) + imageSearch = compile(tagre("img", "src", r'(http://cdn\.thedreamlandchronicles\.com/wp-content/uploads/\d+/\d+/\d+-\d+-\d+[^"]*)')) + prevSearch = compile(tagre("a", "href", r'(%s[^"]*)' % rurl, after='navi-prev"')) + help = 'Index format: page-n or chapter-n' + + @classmethod + def namer(cls, imageUrl, pageUrl): + """Remove trailing digit from day number.""" + name = imageUrl.split('/')[-1] + base, ext = name.split('.', 1) + bp = base.split('-') + if len(bp[2]) == 3: + bp[2] = bp[2][:-1] + return "%s-%s-%s.%s" % (bp[0], bp[1], bp[2], ext) + + class TheNoob(_BasicScraper): url = 'http://www.thenoobcomic.com/index.php' stripUrl = url + '?pos=%s'