From 1d7410c0384c1bb619fa8b022ee9c1522b5ece9c Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 7 Mar 2013 23:51:55 +0100 Subject: [PATCH] Added Zwarwald and AhoiPolloi --- doc/changelog.txt | 4 ++-- dosagelib/plugins/a.py | 16 +++++++++++++++- dosagelib/plugins/z.py | 12 ++++++++++++ tests/test_comics.py | 2 +- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/doc/changelog.txt b/doc/changelog.txt index 67d4080f3..43f4d41e5 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -1,9 +1,9 @@ Dosage 1.13 (released xx.xx.2013) Features: -- comics: Added comic strips AxeCop, Bearmageddon, DeadWinter, +- comics: Added comic strips AhoiPolloi, AxeCop, Bearmageddon, DeadWinter, HarkAVagrant, IAmArg, LoadingArtist, Nnewts, PHDComics, PokeyThePenguin, - SnowFlame and WorldOfMrToast. + SnowFlame and WorldOfMrToast, Zwarwald. Fixes: - cmdline: Catch error when piping output to another diff --git a/dosagelib/plugins/a.py b/dosagelib/plugins/a.py index 3b87dd654..f407784ac 100644 --- a/dosagelib/plugins/a.py +++ b/dosagelib/plugins/a.py @@ -49,6 +49,20 @@ class AcademyVale(_BasicScraper): help = 'Index format: nnn' +class AhoiPolloi(_BasicScraper): + url = 'http://ahoipolloi.blogger.de/' + stripUrl = url + '?day=%s' + firstStripUrl = stripUrl % '20060305' + multipleImagesPerStrip = True + imageSearch = compile(tagre('img', 'src', r'(/static/antville/ahoipolloi/images/[^"]+)')) + prevSearch = compile(tagre('a', 'href', r'(http://ahoipolloi\.blogger\.de/\?day=\d+)')) + help = 'Index format: yyyymmdd' + + @classmethod + def namer(cls, imageUrl, pageUrl): + return imageUrl.rsplit('/', 1)[1] + + class ALessonIsLearned(_BasicScraper): url = 'http://www.alessonislearned.com/' prevSearch = compile(tagre("a", "href", r"(index\.php\?comic=\d+)", quote="'")+r"[^>]+previous") @@ -279,7 +293,7 @@ class AxeCop(_BasicScraper): starter = indirectStarter(url, compile(tagre("a", "href", r'(http://axecop\.com/index\.php/acepisodes/read/episode_\d+/)'))) stripUrl = url + 'index.php/acepisodes/read/episode_%s/' firstStripUrl = stripUrl % '0' - imageSearch = compile(tagre("img", "src", r'(http://axecop\.com/images/uploads/axecop[^"]+)')) + imageSearch = compile(tagre("img", "src", r'(http://axecop\.com/images/uploads/(?:axecop|acmarried)[^"]+)')) prevSearch = compile(tagre("a", "href", r'(http://axecop\.com/index\.php/acepisodes/read/episode_\d+/)') + tagre("img", "src", r'http://axecop\.com/acimages/buttons/page_left\.png')) help = 'Index format: number' diff --git a/dosagelib/plugins/z.py b/dosagelib/plugins/z.py index 6fb3f11b2..783c0262a 100644 --- a/dosagelib/plugins/z.py +++ b/dosagelib/plugins/z.py @@ -45,3 +45,15 @@ class ZombieHunters(_BasicScraper): imageSearch = compile(tagre("img", "src", r'(/istrip_files/strips/[^"]+)')) prevSearch = compile(tagre("a", "href", r'(\?strip_id=\d+)') + tagre("img", "id", "prevcomic")) help = 'Index format: n(unpadded)' + + +class Zwarwald(_BasicScraper): + url = "http://www.zwarwald.de/" + stripUrl = url + 'index.php/page/%s/' + imageSearch = compile(tagre("img", "src", r'(http://www\.zwarwald\.de/images/\d+/\d+/[^"]+)')) + prevSearch = compile(tagre("a", "href", r'(http://www\.zwarwald\.de/index\.php/page/\d+/)') + + tagre("img", "src", r'http://zwarwald\.de/images/prev\.jpg', quote="'")) + help = 'Index format: number' + + def shouldSkipUrl(self, url): + return url in (stripUrl % "112",) diff --git a/tests/test_comics.py b/tests/test_comics.py index d444ad4d0..d5111d355 100644 --- a/tests/test_comics.py +++ b/tests/test_comics.py @@ -122,7 +122,7 @@ def generate_comic_testers(): g = globals() if "TRAVIS" in os.environ: # Get limited number of scraper tests on Travis builds. - max_scrapers = 200 + max_scrapers = 300 scraperclasses = islice(scraper.get_scraperclasses(), 0, max_scrapers) else: scraperclasses = scraper.get_scraperclasses()