Add HagarTheHorrible
This commit is contained in:
parent
75f3d59e85
commit
92150ddbda
1 changed files with 22 additions and 1 deletions
|
@ -2,10 +2,31 @@
|
|||
|
||||
from re import compile
|
||||
from ..scraper import _BasicScraper
|
||||
from ..util import tagre
|
||||
from ..util import tagre, getPageContent, fetchUrls
|
||||
from ..helpers import bounceStarter
|
||||
|
||||
|
||||
class HagarTheHorrible(_BasicScraper):
|
||||
url = 'http://www.hagarthehorrible.net/'
|
||||
stripUrl = 'http://www.hagardunor.net/comicstrips_us.php?serietype=9&colortype=1&serieno=%s'
|
||||
firstStripUrl = stripUrl % '1'
|
||||
multipleImagesPerStrip = True
|
||||
imageSearch = compile(tagre("img", "src", r'(stripus\d+/Hagar_The_Horrible_\d+[^ >]+)', quote=""))
|
||||
prevUrl = r'(comicstrips_us\.php\?serietype\=9\&colortype\=1\&serieno\=\d+)'
|
||||
prevSearch = compile(tagre("a", "href", prevUrl, after="Previous"))
|
||||
help = 'Index format: number'
|
||||
|
||||
@classmethod
|
||||
def starter(cls):
|
||||
"""Return last gallery link."""
|
||||
url = 'http://www.hagardunor.net/comics.php'
|
||||
content = getPageContent(url, cls.session)[0]
|
||||
pattern = compile(tagre("a", "href", cls.prevUrl))
|
||||
for starturl in fetchUrls(url, content, url, pattern):
|
||||
pass
|
||||
return starturl
|
||||
|
||||
|
||||
class HarkAVagrant(_BasicScraper):
|
||||
url = 'http://www.harkavagrant.com/'
|
||||
starter = bounceStarter(url,
|
||||
|
|
Loading…
Reference in a new issue