fixing PandyLand

This commit is contained in:
Damjan Košir 2015-05-20 23:56:49 +12:00
parent fd60065591
commit a05ae9c75d
2 changed files with 14 additions and 22 deletions

View file

@ -1,13 +1,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from ..scraper import make_scraper, _ParserScraper from ..scraper import make_scraper, _ParserScraper
def add(name, url, firstUrl=None, lang=None):
def add(name, url, firstUrl=None, lang=None):
attrs = dict( attrs = dict(
name=name, name=name,
url=url, url=url,
imageSearch='//div[@id="comic"]//img', imageSearch='//div[@id="comic"]//img',
prevSearch = u'//a[contains(text(), " Prev")]', prevSearch=['//a[contains(text(), " Prev")]', "//a[contains(concat(' ', @class, ' '), ' navi-prev ')]"]
) )
if lang: if lang:
attrs['lang'] = lang attrs['lang'] = lang
@ -15,6 +15,8 @@ def add(name, url, firstUrl=None, lang=None):
attrs['firstUrl'] = url + firstUrl attrs['firstUrl'] = url + firstUrl
globals()[name] = make_scraper(name, _ParserScraper, **attrs) globals()[name] = make_scraper(name, _ParserScraper, **attrs)
add('CourtingDisaster', 'http://www.courting-disaster.com/', 'comic/courting-disaster-17/') add('CourtingDisaster', 'http://www.courting-disaster.com/', 'comic/courting-disaster-17/')
add('OnTheEdge', 'http://ontheedgecomics.com/', 'comic/ote0001/') add('OnTheEdge', 'http://ontheedgecomics.com/', 'comic/ote0001/')
add('PandyLand', 'http://pandyland.net/', '1/')
add('Hipsters', 'http://www.hipsters-comic.com/', 'comic/hip01/') add('Hipsters', 'http://www.hipsters-comic.com/', 'comic/hip01/')

View file

@ -8,16 +8,6 @@ from ..helpers import bounceStarter, queryNamer, indirectStarter
from ..util import tagre from ..util import tagre
class PandyLand(_BasicScraper):
url = 'http://pandyland.net/'
rurl = escape(url)
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '1'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s\d+/)' % rurl, after="prev"))
help = 'Index format: number'
class ParadigmShift(_BasicScraper): class ParadigmShift(_BasicScraper):
url = 'http://www.paradigmshiftmanga.com/' url = 'http://www.paradigmshiftmanga.com/'
starter = indirectStarter(url, compile(tagre("a", "href", r'([^"]+)', after="next-comic-link"))) starter = indirectStarter(url, compile(tagre("a", "href", r'([^"]+)', after="next-comic-link")))