dosage/dosagelib/plugins/b.py

307 lines
12 KiB
Python
Raw Normal View History

# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
2013-02-05 18:51:46 +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
2012-10-11 19:32:15 +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 indirectStarter
2012-06-20 19:58:13 +00:00
2013-03-06 19:21:10 +00:00
class BackwaterPlanet(_BasicScraper):
url = 'http://www.backwaterplanet.com/current.htm'
stripUrl = 'http://www.backwaterplanet.com/archive/bwp%s.htm'
imageSearch = compile(r'<img src="(/images/comic/bwp.+?)">')
prevSearch = compile(r'<a href="(/archive/bwp.+?)"><img src="(images/Previous.jpg|/images/Previous.jpg)"')
help = 'Index format: yymmdd'
class BadassMuthas(_BasicScraper):
url = 'http://badassmuthas.com/pages/comic.php'
stripUrl = url + '?%s'
imageSearch = compile(tagre("img", "src", r'(/images/comicsissue[^"]+)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)') + tagre("img", "src", r'/images/comicsbuttonBack\.gif'))
help = 'Index format: nnn'
2013-02-06 21:08:36 +00:00
class BadMachinery(_BasicScraper):
url = 'http://scarygoround.com/'
stripUrl = url + '?date=%s'
imageSearch = compile(tagre("img", "src", r'(strips/\d+[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(\?date=\d+)') + 'Previous')
help = 'Index format: yyyymmdd'
2012-06-20 19:58:13 +00:00
class Bardsworth(_BasicScraper):
url = 'http://www.bardsworth.com/'
stripUrl = url + '?p=%s'
imageSearch = compile(tagre("img", "src", r'(http://www\.bardsworth\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://www\.bardsworth\.com/[^"]+)', after="prev"))
2012-06-20 19:58:13 +00:00
help = 'Index format: nnn'
2013-03-06 19:21:10 +00:00
class Baroquen(_BasicScraper):
url = 'http://www.baroquencomics.com/'
stripUrl = url + '%s/'
imageSearch = compile(tagre("img", "src", r'(http://www\.baroquencomics\.com/Comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://www\.baroquencomics\.com/[^"]+)', after='prev'))
help = 'Index format: yyyy/mm/dd/strip-name'
class Bearmageddon(_BasicScraper):
url = 'http://bearmageddon.com/'
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2011/08/01/page-1'
imageSearch = compile(tagre("img", "src", r'(http://bearmageddon\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://bearmageddon\.com/\d+/\d+/\d+/[^"]+)', after='navi-prev'))
help = 'Index format: yyyy/mm/dd/stripname'
2012-06-20 19:58:13 +00:00
class BetterDays(_BasicScraper):
url = 'http://jaynaylor.com/betterdays/'
stripUrl = url + 'archives/%s.html'
2012-12-02 17:35:06 +00:00
imageSearch = compile(tagre("img", "src", r'(/betterdays/comic/[^>]+)', quote=""))
prevSearch = compile(tagre("a", "href", r'([^"]+)') + '&laquo; Previous')
help = 'Index format: yyyy/mm/<your guess>'
2012-06-20 19:58:13 +00:00
2013-03-06 19:21:10 +00:00
class BetweenFailures(_BasicScraper):
url = 'http://betweenfailures.com/'
stripUrl = url + 'archives/archive/%s'
imageSearch = compile(tagre("img", "src", r'(http://betweenfailures\.com/wp-content/webcomic/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://betweenfailures\.com/archives/archive/[^"]+)', after="previous"))
help = 'Index format: stripnum-strip-name'
class BigFatWhale(_BasicScraper):
url = 'http://www.bigfatwhale.com/'
stripUrl = url + 'archives/bfw_%s.htm'
imageSearch = compile(tagre("img", "src", r'(archives/bfw_[^"]+|bfw_[^"]+)'))
prevSearch = compile(r' HREF="(.+?)" TARGET="_top" TITLE="Previous Cartoon"')
help = 'Index format: nnn'
2012-06-20 19:58:13 +00:00
class BiggerThanCheeses(_BasicScraper):
url = 'http://www.biggercheese.com/'
stripUrl = url + 'index.php?comic=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'src="(comics/.+?)" alt')
prevSearch = compile(r'"(index.php\?comic=.+?)".+?_back')
help = 'Index format: n (unpadded)'
2013-03-06 19:21:10 +00:00
class BillyTheDunce(_BasicScraper):
url = 'http://www.duncepress.com/'
stripUrl = url + '%s/'
imageSearch = compile(tagre("img", "src", r'(http://www\.duncepress\.com/comics/[^"]+)'))
prevSearch = compile(r'<div class="nav-previous"><a href="(http://www.duncepress.com/[^"]+)" rel="prev">')
help = 'Index format: yyyy/mm/strip-name'
2012-06-20 19:58:13 +00:00
class BizarreUprising(_BasicScraper):
url = 'http://www.bizarreuprising.com/'
stripUrl = url + 'view/%s'
imageSearch = compile(tagre("img", "src", r'(comic/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(view/\d+/[^"]+)') + tagre("img", "src", r'images/b_prev\.gif'))
2012-06-20 19:58:13 +00:00
help = 'Index format: n/name'
2013-03-06 19:21:10 +00:00
class BlankIt(_BasicScraper):
url = 'http://blankitcomics.com/'
stripUrl = url + '%s'
imageSearch = compile(tagre("img", "src", r'(http://blankitcomics\.com/bicomics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)', after='rel="prev"'))
help = 'Index format: yyyy/mm/dd/name'
2012-06-20 19:58:13 +00:00
class Blip(_BasicScraper):
url = 'http://blipcomic.com/'
stripUrl = url + 'index.php?strip_id=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'(istrip_files/strips/.+?)"')
prevSearch = compile(r'First.+?"(index.php\?strip_id=.+?)".+?prev')
help = 'Index format: n'
2013-02-18 19:38:44 +00:00
@classmethod
def prevUrlModifier(cls, prevUrl):
if prevUrl:
return prevUrl.replace("www.blipcomic.com", "blipcomic.com")
2012-06-20 19:58:13 +00:00
2013-03-06 19:21:10 +00:00
class BloodBound(_BasicScraper):
url = 'http://bloodboundcomic.com/'
stripUrl = url + '%s'
imageSearch = compile(tagre("img", "src", r'(http://bloodboundcomic\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://bloodboundcomic\.com/[^"]+)', after="prev"))
help = 'Index format: yyyy/mm/name'
2012-06-20 19:58:13 +00:00
class BlueCrashKit(_BasicScraper):
2013-03-04 18:40:10 +00:00
url = 'http://robhamm.com/bluecrashkit/'
stripUrl = url + 'comics/blue-crash-kit/%s'
imageSearch = compile(tagre("img", "src", r'(http://robhamm\.com/bluecrashkit/sites/default/files/comics/[^"]+)'))
prevSearch = compile(r'<li class="previous"><a href="([^"]+)">')
help = 'Index format: yyyy-mm-dd'
2012-06-20 19:58:13 +00:00
class BMovieComic(_BasicScraper):
url = 'http://www.bmoviecomic.com/'
stripUrl = url + '?cid=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'"(comics/.+?)"')
prevSearch = compile(r'(\?cid=.+?)".+?Prev')
help = 'Index format: n'
2013-03-06 19:21:10 +00:00
class BookOfBiff(_BasicScraper):
url = 'http://www.thebookofbiff.com/'
stripUrl = url + '%s'
imageSearch = compile(tagre("img", "src", r'([^"]+/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)', after="Previous"))
help = 'Index format: yyyy/mm/dd/stripnum-strip-name'
2012-06-20 19:58:13 +00:00
class BratHalla(_BasicScraper):
url = 'http://brat-halla.com/'
2013-03-26 16:33:51 +00:00
stripUrl = url + 'comic/%s/'
firstStripUrl = stripUrl % '1-balder-dash'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r"(/comics/.+?)' target='_blank")
prevSearch = compile(r'headernav2".+?"(http.+?)"')
2013-03-26 16:33:51 +00:00
help = 'Index format: number-stripname'
2012-06-20 19:58:13 +00:00
class BrentalFloss(_BasicScraper):
2013-03-08 21:33:05 +00:00
url = 'http://brentalflossthecomic.com/'
stripUrl = url + '?id=%s'
imageSearch = compile(tagre("img", "src", r'([^"]*/img/comic/[^"]*)'))
prevSearch = compile(tagre("a", "href", r'([^"]*)') + "Prev")
help = 'Index format: n'
2013-03-26 16:33:51 +00:00
@classmethod
def prevUrlModifier(cls, prevUrl):
if prevUrl:
return prevUrl.replace("www.", "")
class BrentalFlossFit(BrentalFloss):
name = 'BrentalFloss/FlossedInTime'
url = 'http://brentalflossthecomic.com/fit/'
stripUrl = url + '?id=%s'
@classmethod
def prevUrlModifier(cls, prevUrl):
if prevUrl:
return prevUrl.replace("\n", "")
2013-03-04 18:37:26 +00:00
@classmethod
def imageUrlModifier(cls, url):
if url:
return url.replace("\n", "")
2013-03-07 17:22:24 +00:00
class BrentalFlossGuest(BrentalFloss):
name = 'BrentalFloss/GuestComics'
url = 'http://brentalflossthecomic.com/guestcomics/'
stripUrl = url + '?id=%s'
# XXX disallowed by robots.txt
class _BringBackRoomies(_BasicScraper):
url = "http://www.bringbackroomies.com/"
stripUrl = url + "comic/%s"
2013-03-06 19:21:10 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.bringbackroomies\.com/wp-content/uploads/\d+/\d+/\d+-\d+-\d+[^"]+)'))
prevSearch = compile(tagre("span", "class", "mininav-prev") +
tagre("a", "href", r'(http://www\.bringbackroomies\.com/comic/[^"]+)'))
help = 'Index format: stripname'
2012-06-20 19:58:13 +00:00
class Brink(_BasicScraper):
url = 'http://paperfangs.com/brink/'
stripUrl = url + '?p=%s'
imageSearch = compile(tagre("img", "src", r'(http://paperfangs\.com/brink/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://paperfangs\.com/brink/[^"]+)', after="prev"))
help = 'Index format: n'
2012-06-20 19:58:13 +00:00
2013-03-06 19:21:10 +00:00
class BobWhite(_BasicScraper):
url = 'http://www.bobwhitecomics.com/'
stripUrl = url + '?webcomic_post=%s'
imageSearch = compile(tagre("img", "src", r"(http://www\.bobwhitecomics\.com/wp/wp-content/webcomic/untitled/\d+.jpg)"))
prevSearch = compile(tagre("a", "href", "(http://www\.bobwhitecomics\.com/\?webcomic_post=\d+)")+r'[^"]+Previous')
help = 'Index format: yyyymmdd'
2012-06-20 19:58:13 +00:00
class BoredAndEvil(_BasicScraper):
url = 'http://www.boredandevil.com/'
stripUrl = url + '?date=%s'
imageSearch = compile(tagre("img", "src", r'(strips/[^"]+)'))
2012-06-20 19:58:13 +00:00
prevSearch = compile(r'First Comic.+<a href="(.+?)".+previous-on.gif')
starter = indirectStarter(url, prevSearch)
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyy-mm-dd'
2013-02-06 21:08:36 +00:00
class BoxerHockey(_BasicScraper):
url = 'http://boxerhockey.fireball20xl.com/'
stripUrl = url + '?id=%s'
imageSearch = compile(tagre("img", "src", r'(img/comic/[^"]+)', after="comicimg"))
prevSearch = compile(tagre("a", "href", r'(http://www\.boxerhockey\.com/\?id=\d+)') +
r'[^>]+Previous')
help = 'Index format: n (unpadded)'
2013-02-18 19:38:44 +00:00
@classmethod
def prevUrlModifier(cls, prevUrl):
if prevUrl:
return prevUrl.replace("www.boxerhockey.com", "boxerhockey.fireball20xl.com")
2013-02-06 21:08:36 +00:00
2013-03-06 19:21:10 +00:00
class BoyOnAStickAndSlither(_BasicScraper):
url = 'http://www.boasas.com/'
stripUrl = url + 'page/%s'
imageSearch = compile(tagre("img", "src", r'(http://\d+\.media\.tumblr\.com/[^"]+_1280\.png)'))
prevSearch = compile(tagre("a", "href", r'(/page/\d+)') + "<span>Next page")
help = 'Index format: n (unpadded)'
@classmethod
def namer(cls, imageUrl, pageUrl):
return pageUrl.rsplit('/')[-1]
class BrightlyWound(_BasicScraper):
baseUrl = 'http://www.brightlywound.com/'
url = baseUrl + '?comic=137'
stripUrl = baseUrl + '?comic=%s'
imageSearch = compile(tagre("img", "src", r"(comic/[^']+)", quote="'"))
prevSearch = compile(r'<div id=\'navback\'><a href=\'(\?comic\=\d+)\'><img src=\'images/previous.png\'')
help = 'Index format: nnn'
2013-02-06 21:08:36 +00:00
class BroodHollow(_BasicScraper):
url = 'http://broodhollow.chainsawsuit.com/'
stripUrl = url + '%s/'
imageSearch = compile(tagre("img", "src", r'(http://broodhollow\.chainsawsuit\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://broodhollow\.chainsawsuit\.com/\d+/\d+/\d+/[^"]+)', after="prev"))
help = 'Index format: yyyy/mm/dd/stripname'
# XXX disallowed by robots.txt
class _ButtercupFestival(_BasicScraper):
url = 'http://www.buttercupfestival.com/'
stripUrl = url + '%s.html'
imageSearch = compile(tagre("img", "src", r'(http://www\.buttercupfestival\.com/\d+-\d+[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(\d+-\d+\.html)', quote="") + "previous")
help = 'Index format: number-number'
2013-03-06 19:21:10 +00:00
class ButterSafe(_BasicScraper):
url = 'http://buttersafe.com/'
stripUrl = url + '%s/'
imageSearch = compile(tagre("img", "src", r'(http://buttersafe\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://buttersafe\.com/\d+\d+/\d+/\d+/[^"]+)', after="prev"))
help = 'Index format: yyyy/mm/dd/stripname'
2012-06-20 19:58:13 +00:00
class ButternutSquash(_BasicScraper):
url = 'http://www.butternutsquash.net/'
stripUrl = url + '%s'
2012-11-13 05:51:54 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.butternutsquash\.net/comics/[^"]+)'))
2012-11-13 18:12:28 +00:00
prevSearch = compile(tagre("a", "href", r'(http://www\.butternutsquash\.net/[^"]+)', after="prev"))
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyy/mm/dd/strip-name-author-name'