dosage/dosagelib/plugins/a.py

286 lines
12 KiB
Python
Raw Normal View History

# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
2013-01-09 21:21:19 +00:00
# Copyright (C) 2012-2013 Bastian Kleineidam
2012-11-21 20:57:26 +00:00
2012-06-20 19:58:13 +00:00
from re import compile, MULTILINE
2012-09-26 12:42:28 +00:00
from ..util import tagre
2012-10-11 10:03:12 +00:00
from ..scraper import _BasicScraper
2012-12-02 17:35:06 +00:00
from ..helpers import regexNamer, bounceStarter, indirectStarter
2012-06-20 19:58:13 +00:00
class AbleAndBaker(_BasicScraper):
url = 'http://www.jimburgessdesign.com/comics/index.php'
stripUrl = url + '?comic=%s'
2012-09-26 12:42:28 +00:00
imageSearch = compile(tagre('img', 'src', r'(comics/.+)'))
prevSearch = compile(tagre('a', 'href', r'(.+\d+)') + '.+?previous.gif')
2012-06-20 19:58:13 +00:00
help = 'Index format: nnn'
class AbsurdNotions(_BasicScraper):
url = 'http://www.absurdnotions.org/page129.html'
2012-11-13 18:10:19 +00:00
stripUrl = 'http://www.absurdnotions.org/page%s.html'
2012-09-26 12:42:28 +00:00
imageSearch = compile(tagre('img', 'src', r'(an[^"]+)'))
2012-12-02 17:35:06 +00:00
multipleImagesPerStrip = True
2012-09-26 12:42:28 +00:00
prevSearch = compile(tagre('a', 'href', r'([^"]+)') + tagre('img', 'src', 'nprev\.gif'))
2012-06-20 19:58:13 +00:00
help = 'Index format: n (unpadded)'
class AbstruseGoose(_BasicScraper):
url = 'http://abstrusegoose.com/'
starter = bounceStarter(url,
2013-02-16 13:54:08 +00:00
compile(tagre('a', 'href', r'(http://abstrusegoose\.com/\d+)')+"Next »"))
stripUrl = url + '%s'
2012-09-26 12:42:28 +00:00
imageSearch = compile(tagre('img', 'src', r'(http://abstrusegoose\.com/strips/[^<>"]+)'))
prevSearch = compile(tagre('a', 'href', r'(http://abstrusegoose\.com/\d+)') + r'&laquo; Previous</a>')
2012-06-20 19:58:13 +00:00
help = 'Index format: n (unpadded)'
@classmethod
def namer(cls, imageUrl, pageUrl):
index = int(pageUrl.rstrip('/').split('/')[-1])
name = imageUrl.split('/')[-1].split('.')[0]
return 'c%03d-%s' % (index, name)
class AcademyVale(_BasicScraper):
url = 'http://www.imagerie.com/vale/'
stripUrl = url + 'avarch.cgi?%s'
2012-11-13 05:51:54 +00:00
imageSearch = compile(tagre('img', 'src', r'(avale\d{4}-\d{2}\.gif)'))
prevSearch = compile(tagre('a', 'href', r'(avarch[^">]+)', quote="") + tagre('img', 'src', 'AVNavBack\.gif'))
2012-06-20 19:58:13 +00:00
help = 'Index format: nnn'
2013-03-06 19:21:10 +00:00
class ALessonIsLearned(_BasicScraper):
url = 'http://www.alessonislearned.com/'
prevSearch = compile(tagre("a", "href", r"(index\.php\?comic=\d+)", quote="'")+r"[^>]+previous")
starter = indirectStarter(url, prevSearch)
stripUrl = url + 'index.php?comic=%s'
imageSearch = compile(tagre("img", "src", r"(cmx/lesson\d+\.[a-z]+)"))
help = 'Index format: nnn'
2012-06-20 19:58:13 +00:00
class Alice(_BasicScraper):
url = 'http://alice.alicecomics.com/'
stripUrl = url + '%s/'
2012-11-13 05:51:54 +00:00
imageSearch = compile(tagre("img", "src", r'(http://alice\.alicecomics\.com/wp-content/webcomic/alicecomics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://alice\.alicecomics\.com/archive/[^"]+)', after="previous"))
help = 'Index format: name'
2012-06-20 19:58:13 +00:00
class AlienLovesPredator(_BasicScraper):
url = 'http://alienlovespredator.com/'
stripUrl = url + '%s'
2012-12-02 17:35:06 +00:00
imageSearch = compile(tagre("img", "src", r'([^"]+)', after='border="1" alt="" width="750"'))
prevSearch = compile(tagre("a", "href", r'([^"]+)', after="prev"))
help = 'Index format: yyyy/mm/dd/name/'
2012-06-20 19:58:13 +00:00
2013-02-20 22:34:55 +00:00
class AlphaLuna(_BasicScraper):
url = 'http://www.alphaluna.net/'
stripUrl = url + 'issue-%s/'
imageSearch = compile(tagre("a", "href", r'[^"]*/(?:issue-|support/upcoming)[^"]+') + tagre("img", "src", r'([^"]*/PAGINAS/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)') + tagre("img", "alt", "Prev"))
help = 'Index format: issue/page (e.g. 4/05)'
class AlphaLunaSpanish(AlphaLuna):
name = 'AlphaLuna/Spanish'
url = 'http://alphaluna.net/spanish/'
stripUrl = url + 'issue-%s/'
2012-06-20 19:58:13 +00:00
class Altermeta(_BasicScraper):
url = 'http://altermeta.net/'
stripUrl = url + 'archive.php?comic=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(comics/[^"]+)" />')
prevSearch = compile(r'<a href="([^"]+)"><img src="http://altermeta\.net/template/default/images/sasha/back\.png')
help = 'Index format: n (unpadded)'
class AltermetaOld(Altermeta):
url = 'http://altermeta.net/oldarchive/index.php'
2012-11-13 18:10:19 +00:00
stripUrl = 'http://altermeta.net/oldarchive/archive.php?comic=%s'
2012-06-20 19:58:13 +00:00
prevSearch = compile(r'<a href="([^"]+)">Back')
2012-12-28 04:41:26 +00:00
class AmazingSuperPowers(_BasicScraper):
url = 'http://www.amazingsuperpowers.com/'
stripUrl = url + '%s/'
2012-12-28 04:41:26 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.amazingsuperpowers\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://www\.amazingsuperpowers\.com/[^"]+)', after="prev"))
help = 'Index format: yyyy/mm/name'
2012-06-20 19:58:13 +00:00
class Angels2200(_BasicScraper):
url = 'http://www.janahoffmann.com/angels/'
stripUrl = url + '%s'
2012-12-02 17:35:06 +00:00
imageSearch = compile(tagre("img", "src", r"(http://www\.janahoffmann\.com/angels/comics/[^']+)", quote="'"))
2012-11-19 20:20:34 +00:00
prevSearch = compile(tagre("a", "href", r'([^"]+)')+"&laquo; Previous")
2012-11-14 05:22:08 +00:00
help = 'Index format: yyyy/mm/dd/part-<n>-comic-<n>'
2012-06-20 19:58:13 +00:00
2013-02-06 21:08:36 +00:00
class Antics(_BasicScraper):
url = 'http://www.anticscomic.com/'
stripUrl = url + '?p=%s'
imageSearch = compile(tagre("img", "src", r'(http://www\.anticscomic\.com/comics/\d+-\d+-\d+[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://www\.anticscomic\.com/\?p=\d+)', after='prev'))
help = 'Index format: number'
2012-06-20 19:58:13 +00:00
class AppleGeeks(_BasicScraper):
url = 'http://www.applegeeks.com/'
stripUrl = url + 'comics/viewcomic.php?issue=%s'
2012-12-02 17:35:06 +00:00
imageSearch = compile(tagre("img", "src", r'((?:/comics/)?issue\d+\.jpg)'))
2012-06-20 19:58:13 +00:00
prevSearch = compile(r'<div class="caption">Previous Comic</div>\s*<p><a href="([^"]+)">', MULTILINE)
help = 'Index format: n (unpadded)'
class Achewood(_BasicScraper):
url = 'http://www.achewood.com/'
stripUrl = url + 'index.php?date=%s'
2012-10-12 19:47:57 +00:00
imageSearch = compile(tagre("img", "src", r'(/comic\.php\?date=\d+)'))
prevSearch = compile(tagre("a", "href", r'(index\.php\?date=\d+)', after="Previous"))
2012-06-20 19:58:13 +00:00
help = 'Index format: mmddyyyy'
2012-12-02 17:35:06 +00:00
namer = regexNamer(compile(r'date=(\d+)'))
2012-06-20 19:58:13 +00:00
2013-03-06 19:21:10 +00:00
class ASofterWorld(_BasicScraper):
url = 'http://www.asofterworld.com/'
stripUrl = url + 'index.php?id=%s'
imageSearch = compile(tagre("p", "id", "thecomic") + r'\s*' +
tagre("img", "src", r'(http://www\.asofterworld\.com/clean/[^"]+)'))
prevSearch = compile(tagre("a", "href", "(index\.php\?id=\d+)")+'< back')
help = 'Index format: n (unpadded)'
2012-06-20 19:58:13 +00:00
class AstronomyPOTD(_BasicScraper):
url = 'http://antwrp.gsfc.nasa.gov/apod/astropix.html'
starter = bounceStarter(url,
2013-02-20 19:52:37 +00:00
compile(tagre("a", "href", r'(ap\d{6}\.html)') + "&gt;</a>"))
2012-11-13 18:10:19 +00:00
stripUrl = 'http://antwrp.gsfc.nasa.gov/apod/ap%s.html'
2013-02-20 19:52:37 +00:00
imageSearch = compile(tagre("a", "href", r'(image/\d{4}/[^"]+)'))
2012-12-07 23:45:18 +00:00
multipleImagesPerStrip = True
2013-02-20 19:52:37 +00:00
prevSearch = compile(tagre("a", "href", r'(ap\d{6}\.html)') + "&lt;</a>")
2012-06-20 19:58:13 +00:00
help = 'Index format: yymmdd'
def shouldSkipUrl(self, url):
"""Skip pages without images."""
return url in (
'http://antwrp.gsfc.nasa.gov/apod/ap130217.html', # video
'http://antwrp.gsfc.nasa.gov/apod/ap130218.html', # video
'http://antwrp.gsfc.nasa.gov/apod/ap130226.html', # video
)
2012-06-20 19:58:13 +00:00
@classmethod
def namer(cls, imageUrl, pageUrl):
return '%s-%s' % (pageUrl.split('/')[-1].split('.')[0][2:],
imageUrl.split('/')[-1].split('.')[0])
class AfterStrife(_BasicScraper):
url = 'http://afterstrife.com/?p=262'
2012-11-13 18:10:19 +00:00
stripUrl = 'http://afterstrife.com/?p=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(http://afterstrife.com/strips/.+?)"')
prevSearch = compile(r'<a href="(.+?)" class="navi navi-prev"')
help = 'Index format: nnn'
class ALLCAPS(_BasicScraper):
url = 'http://www.allcapscomix.com/'
stripUrl = url + '%s'
2012-10-11 15:39:38 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.allcapscomix\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)')+r"[^<]+Previous</a>")
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyy/mm/strip-name'
class ASkeweredParadise(_BasicScraper):
url = 'http://aspcomics.net/'
stripUrl = url + 'comic/%s'
2012-10-11 15:39:38 +00:00
imageSearch = compile(tagre("img", "src", r'(http://aspcomics\.net/sites/default/files[^"]*/asp\d+\.jpg)[^"]+'))
prevSearch = compile(tagre("a", "href", "(/comic/\d+)")+r"[^>]+Previous")
2012-06-20 19:58:13 +00:00
help = 'Index format: nnn'
class AGirlAndHerFed(_BasicScraper):
url = 'http://www.agirlandherfed.com/'
starter = bounceStarter(url,
2012-09-24 18:52:08 +00:00
compile(r'<a href="([^"]+)">[^>]+Back'))
stripUrl = url + '1.%s.html'
2012-10-11 15:39:38 +00:00
imageSearch = compile(tagre("img", "src", r'(img/strip/[^"]+\.jpg)'))
2012-09-24 18:52:08 +00:00
prevSearch = compile(r'<a href="([^"]+)">[^>]+Back')
2012-06-20 19:58:13 +00:00
help = 'Index format: nnn'
class AetheriaEpics(_BasicScraper):
url = 'http://aetheria-epics.schala.net/'
stripUrl = url + '%s.html'
imageSearch = compile(tagre("img", "src", r'(\d{5}\.jpg)'))
prevSearch = compile(tagre("a", "href", r'(\d{5}\.html)') + "Previous")
2012-06-20 19:58:13 +00:00
help = 'Index format: nnn'
class AirForceBlues(_BasicScraper):
url = 'http://www.afblues.com/'
stripUrl = url + 'wordpress/%s'
imageSearch = compile(tagre("img", "src", r'(http://www\.afblues\.com/wordpress/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)', after='Previous'))
help = 'Index format: yyyy/mm/dd/name/'
2012-06-20 19:58:13 +00:00
class AlienShores(_BasicScraper):
url = 'http://alienshores.com/alienshores_band/'
stripUrl = url + '%s'
2013-02-12 20:14:32 +00:00
imageSearch = compile(tagre("img", "src", r'(http://alienshores\.com/alienshores_band/wp-content/uploads/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://alienshores\.com/[^"]+)', after="prev"))
help = 'Index format: yyyy/mm/dd/p<nn>/'
2012-06-20 19:58:13 +00:00
class AllTheGrowingThings(_BasicScraper):
url = 'http://growingthings.typodmary.com/'
stripUrl = url + '%s/'
imageSearch = compile(tagre("img", "src", r'(http://growingthings\.typodmary\.com/files/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://growingthings\.typodmary\.com/[^"]+)', after="prev"))
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyy/mm/dd/strip-name'
class Amya(_BasicScraper):
url = 'http://www.amyachronicles.com/'
stripUrl = url + 'archives/%s'
2012-11-12 17:59:19 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.amyachronicles\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://www\.amyachronicles\.com/archives/\d+)', after="Previous"))
2012-11-14 05:22:08 +00:00
help = 'Index format: n'
2012-06-20 19:58:13 +00:00
class Angband(_BasicScraper):
url = 'http://angband.calamarain.net/'
stripUrl = url + 'view.php?date=%s'
2012-10-11 19:32:15 +00:00
imageSearch = compile(tagre("img", "src", r'(comics/Scroll[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(view\.php\?date\=[^"]+)')+"Previous")
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyy-mm-dd'
class AlsoBagels(_BasicScraper):
url = 'http://alsobagels.com/'
stripUrl = url + 'index.php/comic/%s/'
imageSearch = compile(tagre("img", "src", r'(http://alsobagels\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://alsobagels\.com/index\.php/comic/[^"]+)', after="Previous"))
2012-06-20 19:58:13 +00:00
help = 'Index format: strip-name'
class Annyseed(_BasicScraper):
url = 'http://www.colourofivy.com/annyseed_webcomic_latest.htm'
2012-11-13 18:10:19 +00:00
stripUrl = 'http://www.colourofivy.com/annyseed_webcomic%s.htm'
2012-12-02 17:35:06 +00:00
imageSearch = compile(tagre("img", "src", r'(Annyseed[^"]+)'))
prevSearch = compile(r'<a href="(http://www\.colourofivy\.com/[^"]+)"><img src="Last.gif"')
2012-06-20 19:58:13 +00:00
help = 'Index format: nnn'
class AxeCop(_BasicScraper):
url = 'http://axecop.com/'
starter = indirectStarter(url, compile(tagre("a", "href", r'(http://axecop\.com/index\.php/acepisodes/read/episode_\d+/)')))
stripUrl = url + 'index.php/acepisodes/read/episode_%s/'
firstStripUrl = stripUrl % '0'
imageSearch = compile(tagre("img", "src", r'(http://axecop\.com/images/uploads/axecop[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://axecop\.com/index\.php/acepisodes/read/episode_\d+/)') +
tagre("img", "src", r'http://axecop\.com/acimages/buttons/page_left\.png'))
help = 'Index format: number'