fixed EarthsongSaga

This commit is contained in:
Damjan Košir 2015-06-01 11:19:02 +12:00
parent 29c8d2eea0
commit e268b09567

View file

@ -5,20 +5,20 @@
from re import compile, escape, IGNORECASE from re import compile, escape, IGNORECASE
from ..helpers import indirectStarter from ..helpers import indirectStarter
from ..scraper import _BasicScraper from ..scraper import _BasicScraper, _ParserScraper
from ..util import tagre from ..util import tagre
class EarthsongSaga(_BasicScraper): class EarthsongSaga(_ParserScraper):
url = 'http://www.earthsongsaga.com/' url = 'http://earthsongsaga.com/index.php'
starter = indirectStarter(url, compile(tagre("a", "href", r'([^"]+)') + tagre("img", "src", r'[^"]+current\.jpg'))) starter = indirectStarter(url, '//div[@id="leftmenu"]/span[1]/a[1]')
stripUrl = None imageSearch = '//div[@id="comic"]//img'
firstStripUrl = url + 'vol1/vol1cover.html' prevSearch = '//a[@title="Previous"]'
imageSearch = (
compile(tagre("img", "src", r'((?:\.\./)?images/vol\d+/ch\d+/\d+\.\w+)')), @classmethod
compile(tagre("img", "src", r'((?:\.\./)?images/vol\d+/ch\d+/ch\d+cover\.\w+)')), def fetchUrls(cls, url, data, urlSearch):
) urls = super(EarthsongSaga, cls).fetchUrls(url, data, urlSearch)
prevSearch = compile(tagre("a", "href", r'([^"]+)', after="Previous")) return [x.replace('earthsongsaga.com/../', 'earthsongsaga.com/') for x in urls]
@classmethod @classmethod
def namer(cls, imageUrl, pageUrl): def namer(cls, imageUrl, pageUrl):