From ba6e0c09a409f23b6a511b4acbdf08a0595d6da6 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 25 Apr 2013 21:38:18 +0200 Subject: [PATCH] Added Unsound. --- doc/changelog.txt | 10 ++++------ dosagelib/plugins/u.py | 22 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/doc/changelog.txt b/doc/changelog.txt index 946d6020f..dd7bf5891 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -2,18 +2,16 @@ Dosage 2.2 (released xx.xx.2013) Features: - comic: Added ARedTailsDream, Carciphona, Curtailed, GirlGenius, - Lackadaisy, SabrinaOnline, TheDreamlandChronicles, TwoGuysAndGuy. - Patch by Dirk Reiners + Lackadaisy, SabrinaOnline, TheDreamlandChronicles, TwoGuysAndGuy + and Unsound. Patch by Dirk Reiners. Changes: - cmdline: Ignore trailing '/' at end of comic names. Useful - when using shell completion to pick comics. - Patch by Dirk Reiners. + when using shell completion to pick comics. Patch by Dirk Reiners. Fixes: - comics: Fix DorkTower, MadamAndEve and Saturday Morning Breakfast - Cereal, and improve image filenames of CtrlAltDel. - Patch by Dirk Reiners. + Cereal, and improve image filenames of CtrlAltDel. Patch by Dirk Reiners. Dosage 2.1 (released 14.4.2013) diff --git a/dosagelib/plugins/u.py b/dosagelib/plugins/u.py index 817ac5016..dea5abdaa 100644 --- a/dosagelib/plugins/u.py +++ b/dosagelib/plugins/u.py @@ -2,7 +2,7 @@ # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2013 Bastian Kleineidam -from re import compile +from re import compile, escape from ..scraper import _BasicScraper from ..helpers import bounceStarter, indirectStarter @@ -30,6 +30,26 @@ class UnicornJelly(_BasicScraper): help = 'Index format: nnn' +class Unsounded(_BasicScraper): + description = u'Some dead men tell tales, and some little girls have tails...' + url = 'http://www.casualvillain.com/Unsounded/' + stripUrl = url + 'comic/ch%s/ch%s_%s.html' + firstStripUrl = stripUrl % ('01', '01', '01') + rurl = escape(url) + imageSearch = compile(tagre("div", "id", r'comic') + + tagre("img", "src", r'(pageart/[^"]*)') ) + prevSearch = compile(tagre("a", "href", r'([^"]*)', after='class="back')) + starter = indirectStarter(url, + compile(tagre("a", "href", r'(%scomic/[^"]*)' % rurl) + + tagre("img", "src", r"%simages/chibi02\.png" % rurl))) + help = 'Index format: chapter-number' + + def getIndexStripUrl(self, index): + """Get comic strip URL from index.""" + chapter, num = index.split('-') + return self.stripUrl % (chapter, chapter, num) + + # XXX disallowed by robots.txt class _UserFriendly(_BasicScraper): url = 'http://ars.userfriendly.org/cartoons/?mode=classic'