From 09735702952dfcd0fd07c20adbfe2784bd9e49ab Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sun, 16 Apr 2017 01:06:41 +0200 Subject: [PATCH] Fix a bunch of modules. --- dosagelib/plugins/c.py | 8 +++----- dosagelib/plugins/comicsherpa.py | 4 ---- dosagelib/plugins/d.py | 5 ++--- dosagelib/plugins/keenspot.py | 3 +-- dosagelib/plugins/l.py | 10 +--------- dosagelib/plugins/m.py | 1 + dosagelib/plugins/p.py | 12 ++++-------- dosagelib/plugins/t.py | 9 +++++---- scripts/comicsherpa.py | 2 ++ scripts/keenspot.py | 4 ++-- 10 files changed, 21 insertions(+), 37 deletions(-) diff --git a/dosagelib/plugins/c.py b/dosagelib/plugins/c.py index a004dd9e6..d2bd6e88f 100644 --- a/dosagelib/plugins/c.py +++ b/dosagelib/plugins/c.py @@ -102,12 +102,10 @@ class CatVersusHuman(_ParserScraper): starter = indirectStarter -class ChainsawSuit(_ParserScraper): - url = 'http://chainsawsuit.com/' - rurl = escape(url) - stripUrl = url + '%s/' +class ChainsawSuit(_WordPressScraper): + url = 'http://chainsawsuit.com/comic/' + stripUrl = url + 'archive/%s/' firstStripUrl = stripUrl % '2008/03/12/strip-338' - imageSearch = '//div[@id="comic"]//img' prevSearch = '//img[@alt="previous"]/..' help = 'Index format: yyyy/mm/dd/stripname' diff --git a/dosagelib/plugins/comicsherpa.py b/dosagelib/plugins/comicsherpa.py index ab605cde7..ea32c3301 100644 --- a/dosagelib/plugins/comicsherpa.py +++ b/dosagelib/plugins/comicsherpa.py @@ -36,7 +36,6 @@ class ComicSherpa(_ParserScraper): cls('AcornPark', 'csdfe'), cls('Adulting', 'cskky'), cls('AJAndMagnus', 'csrxy'), - cls('AlisonWard', 'cspgh'), cls('AllInGoodTime', 'csjhr'), cls('AmandaTheGreat', 'cssyr'), cls('AndNow', 'csnxr'), @@ -48,7 +47,6 @@ class ComicSherpa(_ParserScraper): cls('BatchRejection', 'csgny'), cls('Bazoobee', 'csfos'), cls('BeMisery', 'csiiq'), - cls('BeneathTheFerns', 'csgzn'), cls('BigJim', 'csiao'), cls('Bluebonnets', 'cston'), cls('BlueSkiesToons', 'csfoy'), @@ -93,7 +91,6 @@ class ComicSherpa(_ParserScraper): cls('GIRTH', 'csbjw'), cls('GrandmaSnoops', 'csscq'), cls('GrannyAnny', 'cskpg'), - cls('Gravy', 'csgvd'), cls('GreenPieces', 'csnwy'), cls('GunstonStreet', 'csgru'), cls('HallEditorialCartoons', 'csgzx'), @@ -116,7 +113,6 @@ class ComicSherpa(_ParserScraper): cls('LiliAndDerek', 'csvsy'), cls('LilleysSillies', 'cstka'), cls('LimboRoad', 'csfpp'), - cls('Loose', 'csmyn'), cls('LumAndAbner', 'cscji'), cls('MadDogGhettoCop', 'cskwp'), cls('MarysNature', 'csogt'), diff --git a/dosagelib/plugins/d.py b/dosagelib/plugins/d.py index 2f21d6d7b..a7b2e5802 100644 --- a/dosagelib/plugins/d.py +++ b/dosagelib/plugins/d.py @@ -10,7 +10,7 @@ from re import compile, escape from ..scraper import _BasicScraper, _ParserScraper from ..helpers import indirectStarter, bounceStarter, xpath_class from ..util import tagre -from .common import _WordPressScraper +from .common import _WPNaviIn class DamnLol(_ParserScraper): @@ -56,10 +56,9 @@ class DarthsAndDroids(_BasicScraper): imageSearch = compile(tagre("img", "src", r'(/comics/darths\d\d\d\d\.jpg)')) -class DasLebenIstKeinPonyhof(_WordPressScraper): +class DasLebenIstKeinPonyhof(_WPNaviIn): url = 'http://sarahburrini.com/wordpress/' firstStripUrl = url + 'comic/mein-erster-webcomic/' - multipleImagesPerStrip = True lang = 'de' diff --git a/dosagelib/plugins/keenspot.py b/dosagelib/plugins/keenspot.py index 040644b78..b0b9c8687 100644 --- a/dosagelib/plugins/keenspot.py +++ b/dosagelib/plugins/keenspot.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam -# Copyright (C) 2015-2016 Tobias Gruetzmacher +# Copyright (C) 2015-2017 Tobias Gruetzmacher from __future__ import absolute_import, division, print_function @@ -111,7 +111,6 @@ class KeenSpot(_ParserScraper): cls('WeirdingWillows', 'weirdingwillows'), cls('WICKEDPOWERED', 'wickedpowered'), cls('WisdomOfMoo', 'wisdomofmoo'), - cls('Yirmumah', 'yirmumah', path="%s/"), # END AUTOUPDATE ) diff --git a/dosagelib/plugins/l.py b/dosagelib/plugins/l.py index 9ca807e92..23355e157 100644 --- a/dosagelib/plugins/l.py +++ b/dosagelib/plugins/l.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam -# Copyright (C) 2015-2016 Tobias Gruetzmacher +# Copyright (C) 2015-2017 Tobias Gruetzmacher from __future__ import absolute_import, division, print_function @@ -51,14 +51,6 @@ class LasLindas(_BasicScraper): help = 'Index format: stripname' -class LastNerdsOnEarth(_ParserScraper): - baseUrl = 'http://www.lastnerdsonearth.com/' - url = baseUrl + 'latest/' - firstStripUrl = baseUrl + 'ch1p1' - imageSearch = '//div[@id="content"]/a/img' - prevSearch = '//div[@id="comicnav"]/a[img[contains(@src, "nav-prev")]]' - - class LeastICouldDo(_BasicScraper): url = 'http://www.leasticoulddo.com/' rurl = escape(url) diff --git a/dosagelib/plugins/m.py b/dosagelib/plugins/m.py index 57973ec9a..26c0ce6a6 100755 --- a/dosagelib/plugins/m.py +++ b/dosagelib/plugins/m.py @@ -113,6 +113,7 @@ class Meiosis(_WordPressScraper): class Melonpool(_WordPressScraper): url = 'http://www.melonpool.com/' + allow_errors = (500,) class MenageA3(_BasicScraper): diff --git a/dosagelib/plugins/p.py b/dosagelib/plugins/p.py index 0fcc65e2c..81e6161b5 100644 --- a/dosagelib/plugins/p.py +++ b/dosagelib/plugins/p.py @@ -182,15 +182,11 @@ class PokeyThePenguin(_ParserScraper): return "%s/index%d.html" % (prefix, num) -class PoorlyDrawnLines(_BasicScraper): +class PoorlyDrawnLines(_ParserScraper): url = 'http://poorlydrawnlines.com/comic/' - rurl = escape(url) - stripUrl = url + '%s' - firstStripUrl = stripUrl % 'campus-characters/' - imageSearch = compile(tagre("img", "src", r'(http://poorlydrawnlines\.com/wp-content/uploads/\d+/\d+/[^"]+)')) - prevSearch = compile(tagre("li", "class", r'previous') + - tagre("a", "href", r'(%s[^"]+)' % rurl)) - help = 'Index Format: name' + firstStripUrl = url + 'campus-characters/' + imageSearch = '//div[%s]//img' % xpath_class('comic') + prevSearch = '//a[@rel="prev"]' class Precocious(_ParserScraper): diff --git a/dosagelib/plugins/t.py b/dosagelib/plugins/t.py index e85efd628..06816d2b9 100644 --- a/dosagelib/plugins/t.py +++ b/dosagelib/plugins/t.py @@ -161,10 +161,11 @@ class TwoGuysAndGuy(_BasicScraper): class Twokinds(_ParserScraper): url = 'http://twokinds.keenspot.com/' - imageSearch = ('//p[@id="cg_img"]//img', - '//article/p//img') - prevSearch = ('//a[@id="cg_back"]', - '//a[%s]' % xpath_class('navprev')) + stripUrl = url + 'comic/%s/' + firstStripUrl = stripUrl % '1' + imageSearch = '//article[%s]//img' % xpath_class('comic') + prevSearch = '//a[%s]' % xpath_class('navprev') + help = 'Index format: n (unpadded)' class TwoLumps(_BasicScraper): diff --git a/scripts/comicsherpa.py b/scripts/comicsherpa.py index 63a80da33..1c0134e6d 100755 --- a/scripts/comicsherpa.py +++ b/scripts/comicsherpa.py @@ -20,9 +20,11 @@ class ComicSherpaUpdater(ComicListUpdater): 'Rufus', # too short + 'BeneathTheFerns', 'BillyAndCo', 'BuffaloChips', 'Crawdiddy', + 'Gravy', 'NewFeature', ) diff --git a/scripts/keenspot.py b/scripts/keenspot.py index af6c70950..7c0b23e45 100755 --- a/scripts/keenspot.py +++ b/scripts/keenspot.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam -# Copyright (C) 2015-2016 Tobias Gruetzmacher +# Copyright (C) 2015-2017 Tobias Gruetzmacher """ Script to get a list of KeenSpot comics and save the info in a JSON file for further processing. @@ -26,6 +26,7 @@ class KeenSpotUpdater(ComicListUpdater): "LastBlood", "TheGodChild", "Twokinds", + "Yirmumah", ) extra = { @@ -34,7 +35,6 @@ class KeenSpotUpdater(ComicListUpdater): 'MysticRevolution': 'path="?cid=%s"', 'PunchAnPie': 'path="daily/%s.html"', 'ShockwaveDarkside': 'path="2d/%s.html"', - 'Yirmumah': 'path="%s/"', } def collect_results(self):