Fix Lackadaisy

This commit is contained in:
Techwolf 2019-06-27 21:48:07 -07:00 committed by Tobias Gruetzmacher
parent c9e3923442
commit 7e6d33ddf5

View file

@ -14,23 +14,20 @@ from .common import (_ComicControlScraper, _WordPressScraper, _WPNaviIn,
WP_LATEST_SEARCH) WP_LATEST_SEARCH)
class Lackadaisy(_BasicScraper): class Lackadaisy(_ParserScraper):
baseUrl = 'http://lackadaisy.foxprints.com/' url = 'https://www.lackadaisy.com/comic.php'
url = baseUrl + 'comic.php' stripUrl = url + '?comicid=%s'
stripUrl = baseUrl + 'comic.php?comicid=%s'
firstStripUrl = stripUrl % '1' firstStripUrl = stripUrl % '1'
imageSearch = compile(tagre("img", "src", r'(http://www\.lackadaisycats\.com/comic/[^"]*)')) imageSearch = '//div[@id="content"]/img'
prevSearch = compile(tagre("a", "href", r"(/comic\.php\?comicid=[0-9]+)") + prevSearch = '//div[@class="prev"]/a'
"< Previous") nextSearch = '//div[@class="next"]/a'
nextSearch = compile(tagre("a", "href", r"(/comic.php\?comicid=[0-9]+)") +
"Next")
help = 'Index format: n' help = 'Index format: n'
starter = bounceStarter starter = bounceStarter
def namer(self, image_url, page_url): def namer(self, imageUrl, pageUrl):
"""Use comic id for filename.""" # Use comic id for filename
num = page_url.rsplit('=', 1)[-1] num = pageUrl.rsplit('=', 1)[-1]
ext = image_url.rsplit('.', 1)[-1] ext = imageUrl.rsplit('.', 1)[-1]
return 'lackadaisy_%s.%s' % (num, ext) return 'lackadaisy_%s.%s' % (num, ext)