dosage/dosagelib/plugins/d.py

178 lines
6.9 KiB
Python
Raw Normal View History

# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
2013-01-28 17:52:26 +00:00
# Copyright (C) 2012-2013 Bastian Kleineidam
2012-11-21 20:57:26 +00:00
2012-11-19 20:20:34 +00:00
from re import compile
2012-06-20 19:58:13 +00:00
2012-10-11 10:03:12 +00:00
from ..scraper import _BasicScraper
2012-11-21 20:57:26 +00:00
from ..helpers import indirectStarter
2012-12-04 06:02:40 +00:00
from ..util import tagre
2012-06-20 19:58:13 +00:00
2012-12-07 23:45:18 +00:00
class DailyDose(_BasicScraper):
url = 'http://dailydoseofcomics.com/'
starter = indirectStarter(url,
2012-12-07 23:45:18 +00:00
compile(tagre("a", "href", r'(http://dailydoseofcomics\.com/[^"]+)', after="preview")))
stripUrl = url + '%s/'
2012-12-07 23:45:18 +00:00
imageSearch = compile(tagre("img", "src", r'([^"]+)', before="align(?:none|center)"))
prevSearch = compile(tagre("a", "href", r'(http://dailydoseofcomics\.com/[^"]+)', after="prev"))
help = 'Index format: stripname'
2012-06-20 19:58:13 +00:00
2012-12-08 20:30:51 +00:00
class Damonk(_BasicScraper):
url = 'http://www.damonk.com/'
stripUrl = url + 'd/%s.html'
2012-12-08 20:30:51 +00:00
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-12-13 20:05:27 +00:00
# XXX disallowed /search by robots.txt
class _DandyAndCompany(_BasicScraper):
url = 'http://www.dandyandcompany.com/'
2012-12-04 06:02:40 +00:00
stripUrl = None
multipleImagesPerStrip = True
imageSearch = compile(tagre("a", "href", r'(http://\d+\.bp\.blogspot\.com/[^"]+)', after="imageanchor"))
prevSearch = compile(tagre("a", "href", r"([^']+)", quote="'", after="Older Posts"))
help = 'Index format: none'
2012-06-20 19:58:13 +00:00
class DarkWings(_BasicScraper):
url = 'http://www.flowerlarkstudios.com/dark-wings/'
stripUrl = url + '%s'
2012-11-21 20:57:26 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.flowerlarkstudios\.com/dark-wings/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://www\.flowerlarkstudios\.com/dark-wings/[^"]+)', after="navi-prev"))
help = 'Index format: yyyy/mm/dd/page-nn-mm'
2012-06-20 19:58:13 +00:00
class DeathToTheExtremist(_BasicScraper):
url = 'http://www.dtecomic.com/'
stripUrl = url + '?n=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'"(comics/.*?)"')
prevSearch = compile(r'</a> <a href="(\?n=.*?)"><.+?/aprev.gif"')
help = 'Index format: nnn'
class DeepFried(_BasicScraper):
url = 'http://www.whatisdeepfried.com/'
stripUrl = url + '%s'
2012-11-21 20:57:26 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.whatisdeepfried\.com/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://www\.whatisdeepfried\.com/[^"]+)', after="prev"))
2012-06-20 19:58:13 +00:00
help = 'Index format: non'
2012-12-07 23:45:18 +00:00
class DMFA(_BasicScraper):
url = 'http://www.missmab.com/'
stripUrl = url + 'Comics/Vol_%s.php'
2012-12-07 23:45:18 +00:00
imageSearch = compile(tagre("img", "src", r'((?:Comics/|Vol)[^"]+)'))
multipleImagesPerStrip = True
prevSearch = compile(tagre("a", "href", r'((?:Comics/)?Vol[^"]+)')+
tagre("img", "src", r'(?:../)?Images/comicprev\.gif'))
help = 'Index format: nnn (normally, some specials)'
2012-06-20 19:58:13 +00:00
class DoemainOfOurOwn(_BasicScraper):
url = 'http://www.doemain.com/'
stripUrl = url + 'index.cgi/%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r"<img border='0' width='\d+' height='\d+' src='(/strips/\d{4}/\d{6}-[^\']+)'")
prevSearch = compile(r'<a href="(/index\.cgi/\d{4}-\d{2}-\d{2})"><img width="\d+" height="\d+" border="\d+" alt="Previous Strip"')
help = 'Index format: yyyy-mm-dd'
class DrFun(_BasicScraper):
url = 'http://www.ibiblio.org/Dave/ar00502.htm'
2012-11-13 18:10:19 +00:00
stripUrl = 'http://www.ibiblio.org/Dave/ar%s.htm'
2013-01-24 06:53:47 +00:00
imageSearch = compile(r'<A HREF= "(Dr-Fun/df\d+/df[^"]+)">')
2012-12-04 06:02:40 +00:00
multipleImagesPerStrip = True
2012-06-20 19:58:13 +00:00
prevSearch = compile(r'<A HREF="(.+?)">Previous Week,')
help = 'Index format: nnnnn'
class Dracula(_BasicScraper):
url = 'http://draculacomic.net/'
stripUrl = url + 'comic.php?comicID=%s'
imageSearch = compile(tagre("img", "src", r'(comics/[^"]+)'))
2012-06-20 19:58:13 +00:00
prevSearch = compile(r'&nbsp;<a class="archivelink" href="(.+?)">&laquo; Prev</a>')
help = 'Index format: nnn'
class DragonTails(_BasicScraper):
url = 'http://www.dragon-tails.com/'
stripUrl = url + 'archive.php?date=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'"(newcomic/.+?)"')
prevSearch = compile(r'"(archive.+?)">.+n_2')
help = 'Index format: yyyy-mm-dd'
class DreamKeepersPrelude(_BasicScraper):
url = 'http://www.dreamkeeperscomic.com/Prelude.php'
stripUrl = url + '?pg=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'(images/PreludeNew/.+?)"')
prevSearch = compile(r'(Prelude.php\?pg=.+?)"')
help = 'Index format: n'
class Drowtales(_BasicScraper):
url = 'http://www.drowtales.com/mainarchive.php'
stripUrl = url + '?sid=%s'
2012-12-04 06:02:40 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.drowtales\.com/mainarchive/[^"]+)'))
2012-11-21 20:57:26 +00:00
prevSearch = compile(tagre("a", "href", r'(\?sid=\d+)', before="link_prev_top"))
help = 'Index format: number'
2012-06-20 19:58:13 +00:00
class DieselSweeties(_BasicScraper):
url = 'http://www.dieselsweeties.com/'
stripUrl = url + 'archive/%s'
2012-11-21 20:57:26 +00:00
imageSearch = compile(tagre("img", "src", r'(/hstrips/[^"]+)'))
2012-12-04 06:02:40 +00:00
prevSearch = compile(tagre("a", "href", r'(/archive/\d+)') +
tagre("img", "src", r'(?:http://www\.dieselsweeties\.com/ximages/blackbackarrow160.png|/ximages/prev\.gif)'))
2012-06-20 19:58:13 +00:00
help = 'Index format: n (unpadded)'
@classmethod
def namer(cls, imageUrl, pageUrl):
index = int(imageUrl.split('/')[-1].split('.')[0])
return 'sw%02d' % (index,)
class DominicDeegan(_BasicScraper):
url = 'http://www.dominic-deegan.com/'
stripUrl = url + 'view.php?date=%s'
2012-12-04 06:02:40 +00:00
imageSearch = compile(tagre("img", "src", r'(comics/\d+\.gif)'))
2012-12-08 20:30:51 +00:00
prevSearch = compile(r'"(view.php\?date=[^"]+)".+?prev21')
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyy-mm-dd'
class DorkTower(_BasicScraper):
url = 'http://www.dorktower.com/'
stripUrl = url + '%s/'
2012-11-21 20:57:26 +00:00
imageSearch = compile(tagre("img", "src", r'(http://www\.dorktower\.com/files/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://www\.dorktower\.com/[^"]+)')+"Previous")
help = 'Index format: yyyy/mm/dd/stripname-dd-mm-yy'
2012-06-20 19:58:13 +00:00
class DresdenCodak(_BasicScraper):
url = 'http://dresdencodak.com/'
2012-11-13 18:10:19 +00:00
stripUrl = None
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="http://dresdencodak.com(/comics/.*?\.jpg)"')
prevSearch = compile(r'<a href="http://dresdencodak.com(/.*?)"><img src=http://dresdencodak.com/m_prev.png>')
starter = indirectStarter('http://dresdencodak.com/', compile(r'<div id="preview"><a href="http://dresdencodak.com/(\d+/\d+/\d+/.*?)">'))
2012-11-26 06:13:32 +00:00
class Dilbert(_BasicScraper):
url = 'http://dilbert.com/'
stripUrl = url + '%s/'
prevSearch = compile(tagre("a", "href", r'(/\d+-\d+-\d+/)', after="STR_Prev"))
imageSearch = compile(tagre("img", "src", r'(/dyn/str_strip/[^"]+\.strip\.zoom\.gif)'))
help = 'Index format: yyyy-mm-dd'
# XXX namer
2013-02-06 21:08:36 +00:00
# XXX disallowed by robots.txt
class _DumbingOfAge(_BasicScraper):
url = 'http://www.dumbingofage.com/'
stripUrl = url + '%s/'
prevSearch = compile(tagre("a", "href", r'(http://www\.dumbingofage\.com/\d+/[^"]+)', after="prev"))
imageSearch = compile(tagre("img", "src", r'(http://www\.dumbingofage\.com/comics/\d+-\d+-\d+[^"]+)'))
help = 'Index format: yyyy/comic/book-num/seriesname/stripname'