dosage/dosagelib/plugins/d.py

302 lines
11 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
2014-01-05 15:50:57 +00:00
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2016 Tobias Gruetzmacher
2012-11-21 20:57:26 +00:00
from __future__ import absolute_import, division, print_function
from re import compile, escape
2012-06-20 19:58:13 +00:00
2015-04-26 10:32:52 +00:00
from ..scraper import _BasicScraper, _ParserScraper
2013-03-18 17:15:19 +00:00
from ..helpers import indirectStarter, bounceStarter
2012-12-04 06:02:40 +00:00
from ..util import tagre
from .common import _WordPressScraper, xpath_class
2012-06-20 19:58:13 +00:00
2016-04-29 22:44:18 +00:00
class DamnLol(_ParserScraper):
2013-04-10 16:19:38 +00:00
url = 'http://www.damnlol.com/'
2016-09-29 22:15:45 +00:00
# Classes for next and previous seem to be swapped...
prevSearch = '//a[%s]' % xpath_class("next")
nextSearch = '//a[%s]' % xpath_class("previous")
imageSearch = '//img[@id="post-image"]'
starter = bounceStarter
2013-04-10 16:19:38 +00:00
def namer(self, image_url, page_url):
ext = image_url.rsplit('.', 1)[1]
path = page_url.rsplit('/', 1)[1][:-5]
2013-04-10 16:19:38 +00:00
stripname, number = path.rsplit('-', 1)
return '%s-%s.%s' % (number, stripname, ext)
2012-12-08 20:30:51 +00:00
class Damonk(_BasicScraper):
url = 'http://www.damonk.com/'
stripUrl = url + 'd/%s.html'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '20060522'
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'))
2012-12-08 20:30:51 +00:00
help = 'Index format: yyyymmdd'
class DangerouslyChloe(_BasicScraper):
url = 'http://www.dangerouslychloe.com/'
stripUrl = url + 'strips-dc/%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % 'chapter_1_-_that_damned_girl'
imageSearch = compile(tagre("img", "src", r'([^"]*/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'([^"]*/strips-dc/[^"]+)', before="cn[id]prevt"))
help = 'Index format: name'
2013-08-19 17:18:02 +00:00
class DarthsAndDroids(_BasicScraper):
url = 'http://www.darthsanddroids.net/'
stripUrl = url + 'episodes/%s.html'
firstStripUrl = stripUrl % '0001'
prevSearch = compile(tagre("a", "href", r'(/episodes/\d\d\d\d.html)') +
'<PREVIOUS')
2013-08-19 17:18:02 +00:00
imageSearch = compile(tagre("img", "src", r'(/comics/darths\d\d\d\d\.jpg)'))
class DasLebenIstKeinPonyhof(_WordPressScraper):
2013-03-21 17:33:16 +00:00
url = 'http://sarahburrini.com/wordpress/'
firstStripUrl = url + 'comic/mein-erster-webcomic/'
2013-04-04 16:30:02 +00:00
multipleImagesPerStrip = True
2013-03-21 17:33:16 +00:00
lang = 'de'
class DeadWinter(_BasicScraper):
url = 'http://deadwinter.cc/'
stripUrl = url + 'page/%s'
firstStripUrl = stripUrl % '1'
imageSearch = compile(tagre("img", "src", r"(/static/page/strip/\d+[^']+)", quote="'"))
prevSearch = compile(tagre("a", "href", r'(/page/\d+)') + "Previous")
help = 'Index format: number'
2012-06-20 19:58:13 +00:00
class DeepFried(_BasicScraper):
url = 'http://www.whatisdeepfried.com/'
rurl = escape(url)
2013-04-10 21:57:09 +00:00
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2001/09/16/new-world-out-of-order'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after="prev"))
2013-04-10 21:57:09 +00:00
help = 'Index format: none'
2012-06-20 19:58:13 +00:00
2015-05-26 10:59:25 +00:00
class DemolitionSquad(_ParserScraper):
2013-03-19 19:45:59 +00:00
url = 'http://www.demolitionsquad.de/'
2014-01-20 18:01:47 +00:00
stripUrl = url + '?comicbeitrag=%s'
firstStripUrl = stripUrl % '181'
2015-05-26 10:59:25 +00:00
imageSearch = '//img[contains(@src,"uploads/pics/")]'
prevSearch = '//img[@name="zuruck"]/..'
2014-01-20 18:01:47 +00:00
help = 'Index format: number'
2013-03-19 19:45:59 +00:00
lang = 'de'
2016-04-29 22:44:18 +00:00
class DerTodUndDasMaedchen(_ParserScraper):
2013-03-21 17:33:16 +00:00
url = 'http://www.cartoontomb.de/deutsch/tod2.php'
stripUrl = url + '?bild=%s.jpg'
firstStripUrl = stripUrl % '00_01_01'
2016-04-29 22:44:18 +00:00
imageSearch = '//img[contains(@src, "images/tod/teil2")]'
prevSearch = u'//a[text()="zur\u00FCck"]'
2013-03-21 17:33:16 +00:00
help = 'Index format: nn_nn_nn'
lang = 'de'
2014-02-18 20:00:19 +00:00
class DieFruehreifen(_BasicScraper):
url = 'http://www.die-fruehreifen.de/index.php'
stripUrl = url + '?id=%s&order=DESC'
firstStripUrl = stripUrl % '1'
2014-07-31 19:18:15 +00:00
imageSearch = compile(tagre("img", "src", r'([^"]*/strips/[Ff]rueh_?[Ss]trip_\d+.jpg)'))
prevSearch = compile(tagre("a", "href", r"(index\.php\?id=\d+&order=DESC)") +
tagre("img", "id", r"naechster"))
2014-02-18 20:00:19 +00:00
help = 'Index format: n (unpadded)'
lang = 'de'
2016-04-29 22:44:18 +00:00
class DieselSweeties(_ParserScraper):
2016-05-05 08:12:03 +00:00
url = 'http://dieselsweeties.com/'
2016-09-29 22:15:45 +00:00
stripUrl = url + 'ics/%s'
2016-04-29 22:44:18 +00:00
firstStripUrl = stripUrl % '1'
imageSearch = '//img[@class="xomic"]'
prevSearch = '//div[@id="prev"]//a[contains(text(), "previous")]'
2016-05-16 21:16:29 +00:00
latestSearch = prevSearch
starter = indirectStarter
2016-04-29 22:44:18 +00:00
help = 'Index format: n (unpadded)'
class DieselSweetiesOld(_ParserScraper):
2016-05-05 08:12:03 +00:00
url = 'http://dieselsweeties.com/archive/'
2016-04-29 22:44:18 +00:00
stripUrl = url + '%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '1'
2016-04-29 22:44:18 +00:00
imageSearch = '//img[contains(@src, "/hstrips/")]'
prevSearch = '//a[contains(@title, "previous")]'
2013-03-06 19:21:10 +00:00
help = 'Index format: n (unpadded)'
2016-04-29 22:44:18 +00:00
endOfLife = True
def starter(self):
return self.stripUrl % '4000'
2013-03-06 19:21:10 +00:00
def namer(self, image_url, page_url):
index = int(image_url.split('/')[-1].split('.')[0])
return 'sw%02d' % index
2013-03-06 19:21:10 +00:00
2016-05-15 23:21:23 +00:00
class Dilbert(_ParserScraper):
2013-03-06 19:21:10 +00:00
url = 'http://dilbert.com/'
2016-05-05 08:12:03 +00:00
stripUrl = url + 'strip/%s'
2013-03-19 19:45:18 +00:00
firstStripUrl = stripUrl % '1989-04-16'
starter = indirectStarter
2016-05-15 23:21:23 +00:00
prevSearch = '//div[%s]/a' % xpath_class('nav-left')
imageSearch = '//img[%s]' % xpath_class('img-comic')
latestSearch = '//a[@class="img-comic-link"]'
2013-03-06 19:21:10 +00:00
help = 'Index format: yyyy-mm-dd'
2013-03-06 19:21:20 +00:00
def namer(self, image_url, page_url):
name = page_url.rsplit("/", 1)[1]
2015-01-16 18:05:53 +00:00
return "%s" % name
2013-03-06 19:21:10 +00:00
2012-12-07 23:45:18 +00:00
class DMFA(_BasicScraper):
url = 'http://www.missmab.com/'
stripUrl = url + 'Comics/Vol_%s.php'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '001'
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'))
2012-12-07 23:45:18 +00:00
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'
2013-03-15 06:04:19 +00:00
class DogHouseDiaries(_BasicScraper):
url = 'http://thedoghousediaries.com/'
rurl = escape(url)
2013-03-15 06:04:19 +00:00
stripUrl = url + '%s'
2015-04-15 16:51:45 +00:00
firstStripUrl = stripUrl % '34'
prevSearch = compile(r"<a id='previouslink' href='(http://thedoghousediaries.com/\d+)'")
2015-04-15 16:56:03 +00:00
imageSearch = compile(r"<img src='(dhdcomics/[^']+)'")
2013-03-15 06:04:19 +00:00
help = 'Index format: number'
2013-03-06 19:21:10 +00:00
class DominicDeegan(_BasicScraper):
url = 'http://www.dominic-deegan.com/'
stripUrl = url + 'view.php?date=%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '2002-05-21'
2013-03-06 19:21:10 +00:00
imageSearch = compile(tagre("img", "src", r'(comics/[^"]+)'))
prevSearch = compile(r'"(view.php\?date=[^"]+)".+?prev21')
help = 'Index format: yyyy-mm-dd'
class DorkTower(_BasicScraper):
url = 'http://www.dorktower.com/'
rurl = escape(url)
2013-03-06 19:21:10 +00:00
stripUrl = url + '%s/'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '1997/01/01/shadis-magazine-strip-1'
imageSearch = compile(tagre("div", "class", "entry-content") +
"\s*<p>\s*" +
tagre("img", "src", r'(%sfiles/[0-9]+/[0-9]+/[^"]*Dork[^"]+\.(?:gif|jpg))' % rurl,
after=' alt'))
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl) + "Previous")
2013-03-06 19:21:10 +00:00
help = 'Index format: yyyy/mm/dd/stripname-dd-mm-yy'
2012-06-20 19:58:13 +00:00
class Dracula(_BasicScraper):
url = 'http://draculacomic.net/'
stripUrl = url + 'comic.php?comicID=%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '0'
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'
2016-09-29 22:15:45 +00:00
class DreamKeepersPrelude(_ParserScraper):
url = 'http://www.dreamkeeperscomic.com/Prelude.php'
stripUrl = url + '?pg=%s'
2016-09-29 22:15:45 +00:00
imageSearch = '//div[@class="Preludecomic"]/table//a/img'
prevSearch = '//a[@id="prev"]'
2012-06-20 19:58:13 +00:00
help = 'Index format: n'
class DresdenCodak(_BasicScraper):
url = 'http://dresdencodak.com/'
rurl = escape(url)
2012-11-13 18:10:19 +00:00
stripUrl = None
2013-04-10 21:57:09 +00:00
firstStripUrl = url + '2007/02/08/pom/'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
2013-04-10 21:57:09 +00:00
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl) +
tagre("img", "src", r"%sm_prev2?\.png" % rurl,
quote=""))
latestSearch = compile(tagre("div", "id", "preview") +
tagre("a", "href",
r'(%s\d+/\d+/\d+/[^"]+)' % rurl))
starter = indirectStarter
2012-06-20 19:58:13 +00:00
2012-11-26 06:13:32 +00:00
2013-04-10 21:57:09 +00:00
class DrFun(_BasicScraper):
2013-04-13 18:58:00 +00:00
baseUrl = 'http://www.ibiblio.org/Dave/'
url = baseUrl + 'ar00502.htm'
stripUrl = baseUrl + 'ar%s.htm'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '00001'
imageSearch = compile(tagre("a", "href", r'(Dr-Fun/df\d+/df[^"]+)'))
multipleImagesPerStrip = True
prevSearch = compile(tagre("a", "href", r'([^"]+)') + 'Previous Week,')
help = 'Index format: nnnnn'
2013-04-29 18:29:56 +00:00
endOfLife = True
2013-04-10 21:57:09 +00:00
2015-01-26 09:21:24 +00:00
class Drive(_BasicScraper):
url = 'http://www.drivecomic.com/'
rurl = escape(url)
stripUrl = url + 'archive/%s.html'
firstStripUrl = stripUrl % '090815'
imageSearch = compile(tagre("img", "src", r'(http://cdn\.drivecomic\.com/strips/main/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(%sarchive/\d+\.html)' % rurl) + "Previous")
help = 'Index format: yymmdd'
class DrMcNinja(_ParserScraper):
2013-03-25 18:47:44 +00:00
url = 'http://drmcninja.com/'
stripUrl = url + 'archives/comic/%s/'
firstStripUrl = stripUrl % '0p1'
css = True
imageSearch = 'div#comic img'
prevSearch = 'a.prev'
help = 'Index format: {episode}p{page}'
2013-03-25 18:47:44 +00:00
2013-03-06 19:21:10 +00:00
class Drowtales(_BasicScraper):
2013-04-13 18:58:00 +00:00
baseUrl = 'http://www.drowtales.com/'
rurl = escape(baseUrl)
url = baseUrl + 'mainarchive.php'
2013-03-06 19:21:10 +00:00
stripUrl = url + '?sid=%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '4192'
2013-04-11 16:27:43 +00:00
imageSearch = (
compile(tagre("img", "src", r'(%smainarchive/[^"]+)' % rurl)),
compile(r'background-image:url\((mainarchive/[^\)]+center\.jpg)'),
)
2013-03-06 19:21:10 +00:00
prevSearch = compile(tagre("a", "href", r'(\?sid=\d+)', before="link_prev_top"))
help = 'Index format: number'
2013-02-06 21:08:36 +00:00
class DumbingOfAge(_BasicScraper):
2013-02-06 21:08:36 +00:00
url = 'http://www.dumbingofage.com/'
rurl = escape(url)
2013-02-06 21:08:36 +00:00
stripUrl = url + '%s/'
prevSearch = compile(tagre("a", "href", r'(%s\d+/[^"]+)' % rurl, after="prev"))
imageSearch = compile(tagre("img", "src", r'(%scomics/\d+-\d+-\d+[^"]+)' % rurl))
2013-02-06 21:08:36 +00:00
help = 'Index format: yyyy/comic/book-num/seriesname/stripname'
2014-02-27 14:08:07 +00:00
2016-04-29 22:44:18 +00:00
class DungeonsAndDenizens(_WordPressScraper):
2014-02-27 14:08:07 +00:00
url = 'http://dungeond.com/'
2016-04-29 22:44:18 +00:00
firstStripUrl = url + '2005/08/23/08232005/'
endOfLife = True
prevSearch = '//a[%s]' % xpath_class('navi-prev')