From 77a9cce00d53100495c0c745475e0f66e70cd2e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damjan=20Ko=C5=A1ir?= Date: Tue, 19 May 2015 19:49:45 +1200 Subject: [PATCH] fixing Hipsters --- dosagelib/plugins/h.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dosagelib/plugins/h.py b/dosagelib/plugins/h.py index 979235e1f..8f145e0b5 100644 --- a/dosagelib/plugins/h.py +++ b/dosagelib/plugins/h.py @@ -2,7 +2,7 @@ # Copyright (C) 2012-2014 Bastian Kleineidam from re import compile, escape -from ..scraper import _BasicScraper +from ..scraper import _BasicScraper, _ParserScraper from ..util import tagre from ..helpers import bounceStarter @@ -58,14 +58,13 @@ class HijinksEnsue(_BasicScraper): help = 'Index format: yyyy/mm/dd/stripname' -class Hipsters(_BasicScraper): +class Hipsters(_ParserScraper): url = 'http://www.hipsters-comic.com/' - rurl = escape(url) - stripUrl = url + '%s/' - firstStripUrl = stripUrl % '2010/08/hip01' - imageSearch = compile(tagre("img", "src", r'(%scomics/\d+-\d+-\d+[^"]+)' % rurl)) - prevSearch = compile(tagre("a", "href", r'(%s\d+/\d+/[^"]+)' % rurl, after="prev")) - help = 'Index format: yyyy/dd/stripname' + stripUrl = url + 'comic/%s/' + firstStripUrl = stripUrl % 'hip01' + imageSearch = '//div[@id="comic"]//img', + prevSearch = '//a[contains(text()," Prev")]', + help = 'Index format: stripname' class HorribleVille(_BasicScraper):