# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
from re import compile, escape, IGNORECASE
from ..helpers import indirectStarter
from ..scraper import _BasicScraper, _ParserScraper
from ..util import tagre
class EarthsongSaga(_ParserScraper):
url = 'http://earthsongsaga.com/index.php'
starter = indirectStarter(url, '//div[@id="leftmenu"]/span[1]/a[1]')
imageSearch = '//div[@id="comic"]//img'
prevSearch = '//a[@title="Previous"]'
@classmethod
def fetchUrls(cls, url, data, urlSearch):
urls = super(EarthsongSaga, cls).fetchUrls(url, data, urlSearch)
return [x.replace('earthsongsaga.com/../', 'earthsongsaga.com/') for x in urls]
@classmethod
def namer(cls, imageUrl, pageUrl):
imgmatch = compile(r'images/vol(\d+)/ch(\d+)/(\d+)\.\w+$', IGNORECASE).search(imageUrl)
if not imgmatch:
imgmatch = compile(r'images/vol(\d+)/ch(\d+)/ch(\d+)cover\.\w+$', IGNORECASE).search(imageUrl)
suffix = "cover"
else:
suffix = ""
return 'vol%02d_ch%02d_%02d%s' % (
int(imgmatch.group(1)), int(imgmatch.group(2)),
int(imgmatch.group(3)), suffix)
class EatLiver(_BasicScraper):
url = 'http://www.eatliver.com/'
rurl = escape(url)
starter = indirectStarter(url, compile(tagre("a", "href", r'(i\.php\?n=\d+)') +
tagre("img", "src", r'img/small/[^"]+') + r"\s*
]+?src="([^"]*?comics/.+?)"')
prevSearch = compile(r'><Previous')
help = 'Index format: yyyy-mm-dd/num'
class EverybodyLovesEricRaymond(_BasicScraper):
url = 'http://geekz.co.uk/lovesraymond/'
stripUrl = url + 'archive/%s'
firstStripUrl = stripUrl % 'slashdotted'
imageSearch = compile(r'')
help = 'Index format: name-of-old-comic'
class EverydayBlues(_BasicScraper):
url = 'http://everydayblues.everydayblues.net/'
rurl = escape(url)
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2010/02/11/sometimes'
prevSearch = compile(tagre("a", "href", r'(%s\d+/\d+/\d+/[^"]+/)' % rurl, after="navi-prev"))
imageSearch = compile(tagre("img", "src", r'(%scomics/\d+-\d+-\d+-[^"]+)' % rurl))
help = 'Index format: yyyy/mm/dd/stripname'
class EvilDiva(_BasicScraper):
url = 'http://www.evildivacomics.com/'
stripUrl = url + '?p=%s'
firstStripUrl = stripUrl % '145'
imageSearch = compile(r'(/comics/.+?)"')
prevSearch = compile(r'http.+?com/(.+?)".+?"prev')
help = 'Index format: n (unpadded)'
class EvilInc(_BasicScraper):
url = 'http://evil-inc.com/'
stripUrl = url + 'comic/%s'
firstStripUrl = stripUrl % 'monday-3'
imageSearch = compile(tagre("div", "id", "comic") +
r'\s*.*\s*' + #filter out the variant href tag
tagre("img", "src", r'(http://i\d\.wp\.com/evil-inc\.com/wp-content/uploads/[^"]+)'))
prevSearch = compile(tagre("span", "class", "mininav-prev") +
tagre("a", "href", r'([^"]+)'))
help = 'Index format: stripname'
class Exiern(_BasicScraper):
url = 'http://www.exiern.com/'
rurl = escape(url)
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2005/09/06/so-far'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after="prev"))
help = 'Index format: yyyy/mm/dd/stripname'
class ExploitationNow(_BasicScraper):
url = 'http://www.exploitationnow.com/'
rurl = escape(url)
stripUrl = url + '%s'
firstStripUrl = stripUrl % '2000-07-07/9'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after="navi-prev"))
help = 'Index format: yyyy-mm-dd/num'
class ExtraLife(_BasicScraper):
url = 'http://www.myextralife.com/'
stripUrl = url + 'comic/%s/'
imageSearch = compile(tagre("img", "src", r'(http://www\.myextralife\.com/wp-content/uploads/[^"]+)', before="comic"))
prevSearch = compile(tagre("a", "href", r'([^"]+)', before="prev_comic"))
help = 'Index format: stripname'
class ExtraOrdinary(_BasicScraper):
url = 'http://www.exocomics.com/'
rurl = escape(url)
stripUrl = url + '%s'
firstStripUrl = stripUrl % '01'
prevSearch = compile(tagre("a", "href", r'(%s\d+)' % rurl, before="prev"))
imageSearch = compile(tagre("img", "src", r'(%scomics/comics/\d+\.[^"]+)' % rurl))
help = 'Index format: number'
class EyeOfRamalach(_BasicScraper):
url = 'http://theeye.katbox.net/'
rurl = escape(url)
stripUrl = url + 'comic/%s/'
imageSearch = compile(tagre("img", "src", r'(%swp-content/uploads/[^"]+)' % rurl, after="data-webcomic-parent"))
prevSearch = compile(tagre("a", "href", r'(%scomic/[^"]+)' % rurl, after="previous"))
help = 'Index format: stripname'