dosage/dosagelib/plugins/e.py

169 lines
6.8 KiB
Python
Raw Normal View History

# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
2012-11-21 20:57:26 +00:00
# Copyright (C) 2012 Bastian Kleineidam
2012-06-20 19:58:13 +00:00
from re import compile, IGNORECASE
2012-10-11 10:03:12 +00:00
from ..helpers import indirectStarter
from ..scraper import _BasicScraper
from ..util import tagre
2012-06-20 19:58:13 +00:00
2012-12-08 20:30:51 +00:00
class EdibleDirt(_BasicScraper):
latestUrl = 'http://eddirt.frozenreality.co.uk/'
stripUrl = latestUrl + 'index.php?id=%s'
imageSearch = compile(tagre("img", "src", r'(strips/[^"]+)'))
prevSearch = compile(tagre("a", "href", r"(index\.php\?id=\d+)")+"Previous")
help = 'Index format: number'
2012-06-20 19:58:13 +00:00
class EerieCuties(_BasicScraper):
latestUrl = 'http://www.eeriecuties.com/'
2012-11-21 20:57:26 +00:00
stripUrl = latestUrl + 'strips-ec/%s'
imageSearch = compile(tagre("img", "src", r'(http://ace\.eeriecuties\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)', before="prev"))
help = 'Index format: stripname'
2012-06-20 19:58:13 +00:00
class Eriadan(_BasicScraper):
2012-11-21 20:57:26 +00:00
latestUrl = 'http://www.shockdom.com/webcomics/eriadan/'
stripUrl = latestUrl + '%s'
2012-12-07 23:45:18 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.shockdom\.com/webcomics/eriadan/files/[^"]+)', after='width="800"'))
2012-11-21 20:57:26 +00:00
prevSearch = compile(tagre("a", "href", r'([^"]+)', after="prev"))
help = 'Index format: yyyy/mm/dd/nnn (unpadded)'
2012-06-20 19:58:13 +00:00
2012-12-08 20:30:51 +00:00
class ElfOnlyInn(_BasicScraper):
latestUrl = 'http://www.elfonlyinn.net/'
stripUrl = latestUrl + 'd/%s.html'
imageSearch = compile(tagre("img", "src", r'(/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(/d/\d+\.html)') +
tagre("img", "src", r'/images/previous_day\.gif'))
help = 'Index format: yyyymmdd'
2012-06-20 19:58:13 +00:00
class ElGoonishShive(_BasicScraper):
name = 'KeenSpot/ElGoonishShive'
latestUrl = 'http://www.egscomics.com/'
stripUrl = latestUrl + '?date=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r"'(comics/.+?)'")
prevSearch = compile(r"<a href='(/\?date=.+?)'.+?arrow_prev.gif")
help = 'Index format: yyyy-mm-dd'
class ElGoonishShiveNP(_BasicScraper):
name = 'KeenSpot/ElGoonishShiveNP'
latestUrl = 'http://www.egscomics.com/egsnp/'
stripUrl = latestUrl + '?date=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<div class=\'comic2\'><img src=\'(comics/\d{4}/\d{2}.+?)\'')
prevSearch = compile(r'<a href=\'(.+?)\'[^>]+?onmouseover=\'\$\("navimg(6|2)"\)')
help = 'Index format: yyyy-mm-dd'
class EmergencyExit(_BasicScraper):
latestUrl = 'http://www.eecomics.net/'
2012-12-04 06:02:40 +00:00
stripUrl = latestUrl + "?strip_id=%s"
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'"(comics/.+?)"')
2012-12-04 06:02:40 +00:00
prevSearch = compile(tagre("a", "href", r'(\?strip_id=\d+)') + tagre("img", "alt", r"Prior"))
help = 'Index format: n'
2012-06-20 19:58:13 +00:00
2012-12-13 20:05:27 +00:00
# XXX disallowed by robots.txt
class _ErrantStory(_BasicScraper):
2012-06-20 19:58:13 +00:00
latestUrl = 'http://www.errantstory.com/'
2012-11-21 20:57:26 +00:00
stripUrl = latestUrl + '%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img[^>]+?src="([^"]*?comics/.+?)"')
prevSearch = compile(r'><a href="(.+?)">&lt;Previous</a>')
2012-11-21 20:57:26 +00:00
help = 'Index format: yyyy-mm-dd/num'
2012-06-20 19:58:13 +00:00
class Evercrest(_BasicScraper):
latestUrl = 'http://www.evercrest.com/archives/20030308'
2012-11-21 20:57:26 +00:00
stripUrl = 'http://www.evercrest.com/archives/%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img.+?src="([^"]*/(images/oldstrips|archives/i)/[^"]*)"')
2012-11-21 20:57:26 +00:00
prevSearch = compile(r'<a.+?href="(http://www\.evercrest\.com/archives/\d+)">&lt; Previous')
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyymmdd'
class EverybodyLovesEricRaymond(_BasicScraper):
latestUrl = 'http://geekz.co.uk/lovesraymond/'
stripUrl = latestUrl + 'archive/%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="((?:http://geekz.co.uk)?/lovesraymond/wp-content(?:/images)/ep\d+\w?\.jpg)"', IGNORECASE)
prevSearch = compile(r'&laquo; <a href="(http://geekz.co.uk/lovesraymond/archive/[^/"]*)">')
help = 'Index format: name-of-old-comic'
class EvilDiva(_BasicScraper):
latestUrl = 'http://www.evildivacomics.com/'
2012-11-21 20:57:26 +00:00
stripUrl = latestUrl + '?p=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'(/comics/.+?)"')
prevSearch = compile(r'http.+?com/(.+?)".+?"prev')
2012-11-21 20:57:26 +00:00
help = 'Index format: n (unpadded)'
2012-06-20 19:58:13 +00:00
class EvilInc(_BasicScraper):
latestUrl = 'http://www.evil-comic.com/'
2012-11-21 20:57:26 +00:00
stripUrl = latestUrl + 'archive/%s.html'
imageSearch = compile(tagre("img", "src", r'(/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)') + tagre("img", "src", r'/images/previous\.gif'))
help = 'Index format: yyyymmdd'
2012-06-20 19:58:13 +00:00
class Exiern(_BasicScraper):
latestUrl = 'http://www.exiern.com/'
2012-11-21 20:57:26 +00:00
stripUrl = latestUrl + '?p=%s'
2012-12-04 06:02:40 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.exiern\.com/comics/[^"]+)'))
2012-11-21 20:57:26 +00:00
prevSearch = compile(tagre("a", "href", r'(http://www\.exiern\.com/[^"]+)', after="prev"))
help = 'Index format: n'
2012-06-20 19:58:13 +00:00
class ExiernDarkReflections(_BasicScraper):
latestUrl = 'http://darkreflections.exiern.com/'
stripUrl = latestUrl + 'index.php?strip_id=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'"(istrip.+?)"')
prevSearch = compile(r'First.+?(/index.+?)".+?prev')
help = 'Index format: n'
class ExtraLife(_BasicScraper):
latestUrl = 'http://www.myextralife.com/'
stripUrl = latestUrl + 'comic/%s/'
2012-11-21 20:57:26 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.myextralife\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)', after="prev"))
help = 'Index format: stripname'
2012-06-20 19:58:13 +00:00
class EyeOfRamalach(_BasicScraper):
latestUrl = 'http://theeye.katbox.net/'
2012-11-21 20:57:26 +00:00
stripUrl = latestUrl + 'archive/%s/'
imageSearch = compile(tagre("img", "src", r'(http://theeye\.katbox\.net/wp-content/webcomic/theeye/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://theeye\.katbox\.net/archive/[^"]+)', after="previous"))
2012-06-20 19:58:13 +00:00
help = 'Index format: n (unpadded)'
class EarthsongSaga(_BasicScraper):
2012-11-21 20:57:26 +00:00
starter = indirectStarter('http://www.earthsongsaga.com/', compile(tagre("a", "href", r'([^"]+)') + tagre("img", "src", r'[^"]+current\.jpg')))
2012-11-13 18:10:19 +00:00
stripUrl = None
2012-11-21 20:57:26 +00:00
imageSearch = compile(tagre("img", "src", r'((?:\.\./)?images/vol\d+/ch\d+/\d+\.\w+)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)', after="Previous"))
2012-06-20 19:58:13 +00:00
@classmethod
def namer(cls, imageUrl, pageUrl):
imgmatch = compile(r'images/vol(\d+)/ch(\d+)/(\d+)\.\w+$', IGNORECASE).search(imageUrl)
return 'vol%02d_ch%02d_%02d' % (int(imgmatch.group(1)), int(imgmatch.group(2)), int(imgmatch.group(3)))
class ExploitationNow(_BasicScraper):
2012-11-21 20:57:26 +00:00
latestUrl = 'http://www.exploitationnow.com/'
stripUrl = latestUrl + '%s'
imageSearch = compile(tagre("img", "src", r'(http://www\.exploitationnow\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://www\.exploitationnow\.com/[^"]+)', after="navi-prev"))
help = 'Index format: yyyy-mm-dd/num'
2012-06-20 19:58:13 +00:00
class Ellerbisms(_BasicScraper):
latestUrl = 'http://www.ellerbisms.com/'
stripUrl = latestUrl + '?p=%s'
2012-12-04 06:02:40 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.ellerbisms\.com/comics/[^"]+)'))
2012-11-21 20:57:26 +00:00
prevSearch = compile(tagre("a", "href", r'(http://www\.ellerbisms\.com/[^"]+)', after="prev"))
2012-06-20 19:58:13 +00:00
help = 'Index format: nnn'