From 7e39b291dc07da1646cd29023d79322c72a2e469 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Wed, 14 Nov 2012 20:23:30 +0100 Subject: [PATCH] Fix some comics --- dosagelib/plugins/b.py | 2 +- dosagelib/plugins/c.py | 35 ++++++++++++++++------------------- dosagelib/util.py | 3 +++ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/dosagelib/plugins/b.py b/dosagelib/plugins/b.py index 01276c46e..797d03de7 100644 --- a/dosagelib/plugins/b.py +++ b/dosagelib/plugins/b.py @@ -134,7 +134,7 @@ def blankLabel(name, baseUrl): dict( name='BlankLabel/' + name, latestUrl=baseUrl, - stripUrl=baseUrl+'d/%s.shtml', + stripUrl=baseUrl+'d/%s.html', imageSearch=compile(tagre("img", "src", r'(/comic[s|/][^"]+)')), prevSearch=compile(tagre("a", "href", r'[^"]*(/d/\d+\.s?html)')+r"[^>]+/images/(?:nav_02|previous_day)\.gif"), #prevSearch=compile(r'(?:"([^"]*(?:/d/[^"\r\n]*)|(?:/strip/.+?))")(?:(?:.{43}starshift_back.gif)|(?:.+?cxn_previous)|(?:.{43}previous)|(?:[^<>]*>[^<>]*<[^<>]*previous)|(?:.*?back_button)|(?:.*?comicnav-previous))'), diff --git a/dosagelib/plugins/c.py b/dosagelib/plugins/c.py index 004925a29..0883b505c 100644 --- a/dosagelib/plugins/c.py +++ b/dosagelib/plugins/c.py @@ -50,10 +50,10 @@ class CaribbeanBlue(_BasicScraper): class Catena(_BasicScraper): latestUrl = 'http://catenamanor.com/' - stripUrl = 'http://catenamanor.com/%s.gif' + stripUrl = latestUrl + '%s' imageSearch = compile(tagre("img", "src", r'(http://catenamanor\.com/comics/[^"]+)')) prevSearch = compile(tagre("a", "href", r'([^"]+)', after='rel="prev"')) - help = 'Index format: yyyy-mm-dd-' + help = 'Index format: yyyy/mm/dd/' class Catharsis(_BasicScraper): @@ -109,16 +109,15 @@ class CigarroAndCerveja(_BasicScraper): help = 'Index format: non' - -class CombustibleOrange(_BasicScraper): - latestUrl = 'http://www.combustibleorange.com/' - stripUrl = 'http://www.combustibleorange.com/index.php?current=%s' - imageSearch = compile(r'') +# XXX move +class TinyKittenTeeth(_BasicScraper): + latestUrl = 'http://www.tinykittenteeth.com/' + stripUrl = latestUrl + 'index.php?current=%s' + imageSearch = compile(tagre("img", "src", r'(http://www\.tinykittenteeth\.com/comics/[^"]+)')) + prevSearch = compile(tagre("a", "href", r'([^"]+)', after="Previous")) help = 'Index format: n (unpadded)' - class Comedity(_BasicScraper): latestUrl = 'http://www.comedity.com/' stripUrl = 'http://www.comedity.com/index.php?strip_id=%s' @@ -156,28 +155,26 @@ class CourtingDisaster(_BasicScraper): class CrapIDrewOnMyLunchBreak(_BasicScraper): latestUrl = 'http://crap.jinwicked.com/' - stripUrl = 'http://crap.jinwicked.com/%s' - imageSearch = compile(r'') help = 'Index format: nnn' diff --git a/dosagelib/util.py b/dosagelib/util.py index d89d378cd..a5ea8722d 100644 --- a/dosagelib/util.py +++ b/dosagelib/util.py @@ -166,6 +166,9 @@ def normaliseURL(url): while segments and segments[0] == '': del segments[0] pu[2] = '/' + '/'.join(segments) + # remove leading '&' from query + if pu[3].startswith('&'): + pu[3] = pu[3][1:] return urlparse.urlunparse(pu) def urlopen(url, referrer=None, retries=3, retry_wait_seconds=5):