dosage/dosagelib/plugins/b.py

380 lines
15 KiB
Python
Raw Normal View History

# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
2014-01-05 15:50:57 +00:00
# Copyright (C) 2012-2014 Bastian Kleineidam
2012-11-21 20:57:26 +00:00
from re import compile, escape
2012-06-20 19:58:13 +00:00
2012-10-11 19:32:15 +00:00
from ..util import tagre
from ..scraper import _BasicScraper, _ParserScraper
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):
2013-04-14 07:02:14 +00:00
description = u'Nobody wants to work for a living. Get yourself some super-powers and come ill with us. Full color update every Friday.'
2013-03-06 19:21:10 +00:00
url = 'http://badassmuthas.com/pages/comic.php'
stripUrl = url + '?%s'
firstStripUrl = stripUrl % '1'
2013-03-06 19:21:10 +00:00
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'
firstStripUrl = stripUrl % '20090918'
2013-02-06 21:08:36 +00:00
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):
2013-04-14 07:02:14 +00:00
description = u'Bardsworth - Magic, Mischief, and Cookies'
url = 'http://www.bardsworth.com/'
rurl = escape(url)
2014-01-24 22:17:21 +00:00
stripUrl = url + '?comic=%s'
firstStripUrl = stripUrl % '750'
2014-01-24 22:17:21 +00:00
imageSearch = compile(tagre("img", "src", r'(%swp-content/uploads/\d+/\d+/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after="prev"))
2014-01-24 22:17:21 +00:00
help = 'Index format: stripname'
2012-06-20 19:58:13 +00:00
2013-03-06 19:21:10 +00:00
class Baroquen(_BasicScraper):
url = 'http://www.baroquencomics.com/'
rurl = escape(url)
2013-03-06 19:21:10 +00:00
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2008/11/05/raise-the-curtains'
imageSearch = compile(tagre("img", "src", r'(%sComics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after='prev'))
2013-03-06 19:21:10 +00:00
help = 'Index format: yyyy/mm/dd/strip-name'
class Bearmageddon(_BasicScraper):
url = 'http://bearmageddon.com/'
rurl = escape(url)
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2011/08/01/page-1'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s\d+/\d+/\d+/[^"]+)' % rurl, after='navi-prev'))
help = 'Index format: yyyy/mm/dd/stripname'
2012-06-20 19:58:13 +00:00
class BetterDays(_BasicScraper):
2013-04-19 04:31:12 +00:00
description = u'Better Days'
url = 'http://jaynaylor.com/betterdays/'
stripUrl = url + 'archives/%s.html'
firstStripUrl = stripUrl % '2003/04/post-2'
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):
2013-04-19 04:31:12 +00:00
description = u'Between Failures'
2013-03-06 19:21:10 +00:00
url = 'http://betweenfailures.com/'
rurl = escape(url)
2013-04-28 17:58:38 +00:00
stripUrl = url + 'comics1/%s'
imageSearch = compile(tagre("img", "src", r'(%swp-content/uploads/\d+/\d+/\d+-\d+-\d+[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%scomics1/[^"]+)' % rurl, after="previous"))
help = 'Index format: stripname'
2013-03-06 19:21:10 +00:00
class BigFatWhale(_BasicScraper):
2013-04-14 07:02:14 +00:00
description = u'A weekly comic strip for those who are not dumb.'
2013-03-06 19:21:10 +00:00
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):
2013-04-19 04:31:12 +00:00
description = u'Bigger Than Cheeses - My webcomic will knife fight your webcomic'
url = 'http://www.biggercheese.com/'
stripUrl = url + 'index.php?comic=%s'
firstStripUrl = stripUrl % '1'
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):
2013-04-14 07:02:14 +00:00
description = u"Billy the Dunce: A webcomic about some genius kids, some supernatural creatures, and one dumb kid who's stuck with them. Like Goonies, but with more Lovecraft."
2013-03-06 19:21:10 +00:00
url = 'http://www.duncepress.com/'
rurl = escape(url)
2013-03-06 19:21:10 +00:00
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2009/06/an-introduction-of-sorts'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(r'<div class="nav-previous"><a href="(%s[^"]+)" rel="prev">' % rurl)
help = 'Index format: yyyy/mm/stripname'
2013-03-06 19:21:10 +00:00
2012-06-20 19:58:13 +00:00
class BizarreUprising(_BasicScraper):
2013-04-14 07:02:14 +00:00
description = u"Bizarre Uprising - Manga that's not just good, it's good for you!"
url = 'http://www.bizarreuprising.com/'
stripUrl = url + 'view/%s'
firstStripUrl = stripUrl % '1/awakening-splash'
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'
class BladeKitten(_ParserScraper):
description = u"Blade Kitten aka Kit Ballard, is the hottest and best bounty hunter in the Korunda System and isn't afraid to let people know it!"
url = 'http://www.bladekitten.com/'
stripUrl = url + 'comics/blade-kitten/%s/page:%s'
firstStripUrl = stripUrl % ('1','1')
imageSearch = '//img[@class="comic_page_image"]'
prevSearch = '//span[@class="comic_nav_prev"]//a'
textSearch = '//div[@class="comic_comment_inner"]//p'
textOptional = True
help = 'Index format: chapter-page'
starter = indirectStarter(url, '//h4//a[contains(@href, "/comics/")]')
def getIndexStripUrl(self, index):
return self.stripUrl % tuple(index.split('-'))
@classmethod
def namer(cls, imageUrl, pageUrl):
filename = imageUrl.rsplit('/', 1)[1]
_, chapter, page = pageUrl.rsplit('/', 2)
page = page.split(':')[1]
return "bladekitten-%02i-%02i-%s" % (int(chapter), int(page), filename)
2013-03-06 19:21:10 +00:00
class BlankIt(_BasicScraper):
2013-04-14 07:02:14 +00:00
description = u'An absurd, insane, and delightful webcomic from Aric McKeown and Lem Pew.'
2013-03-06 19:21:10 +00:00
url = 'http://blankitcomics.com/'
2013-04-11 16:27:43 +00:00
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '0001'
2013-03-06 19:21:10 +00:00
imageSearch = compile(tagre("img", "src", r'(http://blankitcomics\.com/bicomics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)', after='rel="prev"'))
2013-04-11 16:27:43 +00:00
help = 'Index format: stripname'
2013-03-06 19:21:10 +00:00
2012-06-20 19:58:13 +00:00
class Blip(_BasicScraper):
url = 'http://blipcomic.com/'
stripUrl = url + 'index.php?strip_id=%s'
firstStripUrl = stripUrl % '1'
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):
2013-04-14 07:02:14 +00:00
description = u'Demonic Vampire Hotness'
2013-11-12 19:13:58 +00:00
adult = True
2013-03-06 19:21:10 +00:00
url = 'http://bloodboundcomic.com/'
rurl = escape(url)
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2006/06/06112006'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after="prev"))
2013-03-06 19:21:10 +00:00
help = 'Index format: yyyy/mm/name'
2012-06-20 19:58:13 +00:00
class BMovieComic(_BasicScraper):
2013-04-14 07:02:14 +00:00
description = u"A group of unlikely heroes tackles monsters, mutants and aliens from Hollywood's past and present. See what happens. Or they'll say you haven't seen it."
url = 'http://www.bmoviecomic.com/'
stripUrl = url + '?cid=%s'
firstStripUrl = stripUrl % '8'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'"(comics/.+?)"')
prevSearch = compile(r'(\?cid=.+?)".+?Prev')
help = 'Index format: n'
2013-04-10 16:36:33 +00:00
class BobWhite(_BasicScraper):
2013-04-19 04:31:12 +00:00
description = u'Bobwhite by Magnolia Porter'
2013-04-10 16:36:33 +00:00
url = 'http://www.bobwhitecomics.com/'
rurl = escape(url)
stripUrl = url + '?webcomic_post=%s'
firstStripUrl = stripUrl % '20110504'
imageSearch = compile(tagre("img", "src", r"(%swp/wp-content/webcomic/untitled/\d+.jpg)" % rurl))
prevSearch = compile(tagre("a", "href", "(%s\?webcomic_post=\d+)" % rurl)+r'[^"]+Previous')
help = 'Index format: yyyymmdd'
2013-03-06 19:21:10 +00:00
class BookOfBiff(_BasicScraper):
2013-04-19 04:31:12 +00:00
description = u'The Book of Biff - new adventures every monday through friday'
2013-11-12 17:33:14 +00:00
url = 'http://thebookofbiff.com/'
2013-04-10 21:57:09 +00:00
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2006/01/02/4'
2013-03-06 19:21:10 +00:00
imageSearch = compile(tagre("img", "src", r'([^"]+/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'([^"]+)', after="Previous"))
2013-04-10 21:57:09 +00:00
help = 'Index format: yyyy/mm/dd/stripnum-stripname'
2013-03-06 19:21:10 +00:00
2013-04-10 16:36:33 +00:00
class BoredAndEvil(_BasicScraper):
url = 'http://www.boredandevil.com/'
stripUrl = url + '?date=%s'
firstStripUrl = stripUrl % '2004-06-07'
imageSearch = compile(tagre("img", "src", r'(strips/[^"]+)'))
prevSearch = compile(r'First Comic.+<a href="(.+?)".+previous-on.gif')
starter = indirectStarter(url, prevSearch)
help = 'Index format: yyyy-mm-dd'
class BoxerHockey(_BasicScraper):
2013-04-19 04:31:12 +00:00
description = u'Boxer Hockey'
2013-04-10 16:36:33 +00:00
url = 'http://boxerhockey.fireball20xl.com/'
stripUrl = url + '?id=%s'
firstStripUrl = stripUrl % '56'
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)'
@classmethod
def prevUrlModifier(cls, prevUrl):
if prevUrl:
return prevUrl.replace("www.boxerhockey.com", "boxerhockey.fireball20xl.com")
class BoyOnAStickAndSlither(_BasicScraper):
2013-04-14 07:02:14 +00:00
description = u'A comic about killer bees, time travel, ethics and despair.'
2013-04-10 16:36:33 +00:00
url = 'http://www.boasas.com/'
stripUrl = url + 'page/%s'
firstStripUrl = stripUrl % '2'
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]
2012-06-20 19:58:13 +00:00
class BratHalla(_BasicScraper):
2013-04-14 07:02:14 +00:00
description = u'Norse mythology webcomic where young Thor, Loki, Balder, Hod and more face off against grade school and make an old man out of their immortal dad Odin'
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-04-14 07:02:14 +00:00
description = u'brentalfloss the comic :: Off To The Races'
2013-03-08 21:33:05 +00:00
url = 'http://brentalflossthecomic.com/'
stripUrl = url + '?id=%s'
fristStripUrl = stripUrl % '1'
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'
fristStripUrl = stripUrl % '1'
@classmethod
def prevUrlModifier(cls, prevUrl):
if prevUrl:
return prevUrl.replace("\n", "")
2013-03-04 18:37:26 +00:00
@classmethod
def imageUrlModifier(cls, url, data):
2013-03-04 18:37:26 +00:00
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'
fristStripUrl = stripUrl % '1'
# XXX disallowed by robots.txt
class _BringBackRoomies(_BasicScraper):
url = "http://www.bringbackroomies.com/"
rurl = escape(url)
stripUrl = url + "comic/%s"
imageSearch = compile(tagre("img", "src", r'(%swp-content/uploads/\d+/\d+/\d+-\d+-\d+[^"]+)' % rurl))
prevSearch = compile(tagre("span", "class", "mininav-prev") +
tagre("a", "href", r'(%scomic/[^"]+)' % rurl))
help = 'Index format: stripname'
2012-06-20 19:58:13 +00:00
class Brink(_BasicScraper):
2013-04-14 07:02:14 +00:00
description = u"BRINK - You're not as crazy as you think you are"
url = 'http://paperfangs.com/brink/'
rurl = escape(url)
stripUrl = url + '?p=%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '5'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after="prev"))
help = 'Index format: number'
2012-06-20 19:58:13 +00:00
2013-03-06 19:21:10 +00:00
class BrightlyWound(_BasicScraper):
2013-04-14 07:02:14 +00:00
description = u'A webcomic of physics, astronomy, math, and grammar.'
2013-03-06 19:21:10 +00:00
baseUrl = 'http://www.brightlywound.com/'
url = baseUrl + '?comic=137'
stripUrl = baseUrl + '?comic=%s'
fristStripUrl = stripUrl % '0'
2013-03-06 19:21:10 +00:00
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):
2013-04-14 07:02:14 +00:00
description = u'Broodhollow - A MWF cosmic horror adventure comic by Kris Straub'
2013-02-06 21:08:36 +00:00
url = 'http://broodhollow.chainsawsuit.com/'
rurl = escape(url)
2013-11-12 17:33:14 +00:00
stripUrl = url + 'page/%s/'
firstStripUrl = stripUrl % '2012/10/08/broodhollow'
2013-11-12 17:33:14 +00:00
imageSearch = compile(tagre("img", "src", r'(%swp-content/uploads/\d+/\d+/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%spage/\d+/\d+/\d+/[^"]+)' % rurl, after="prev"))
2013-02-06 21:08:36 +00:00
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/'
rurl = escape(url)
2013-03-06 19:21:10 +00:00
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2007/04/03/breakfast-sad-turtle'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s\d+\d+/\d+/\d+/[^"]+)' % rurl, after="prev"))
2013-03-06 19:21:10 +00:00
help = 'Index format: yyyy/mm/dd/stripname'
2012-06-20 19:58:13 +00:00
class ButternutSquash(_BasicScraper):
2013-04-19 04:31:12 +00:00
description = u'ButterNutSquash - by P\xe9rez & Coughler'
url = 'http://www.butternutsquash.net/'
rurl = escape(url)
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2003/04/16/meet-da-punks'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after="prev"))
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyy/mm/dd/strip-name-author-name'