dosage/dosagelib/plugins/i.py

87 lines
2.9 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
2016-10-28 22:21:41 +00:00
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
2014-01-05 15:50:57 +00:00
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2020 Tobias Gruetzmacher
# Copyright (C) 2019-2020 Daniel Ring
from re import compile, escape
2020-03-04 06:03:14 +00:00
from ..helpers import indirectStarter
2019-06-19 08:27:06 +00:00
from ..scraper import _BasicScraper, _ParserScraper
from ..util import tagre
2020-03-04 06:03:14 +00:00
from .common import _WordPressScraper, _WPNavi, _WPWebcomic
2012-06-20 19:58:13 +00:00
class IAmArg(_BasicScraper):
url = 'http://iamarg.com/'
rurl = escape(url)
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2011/05/08/05082011'
2015-04-15 18:43:06 +00:00
imageSearch = compile(tagre("img", "src", r'(//iamarg.com/comics/\d+-\d+-\d+[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(%s\d+/\d+/\d+/[^"]+)' % rurl, after="prev"))
help = 'Index format: yyyy/mm/dd/stripname'
2013-07-04 10:22:20 +00:00
class ICanBarelyDraw(_BasicScraper):
url = 'http://www.icanbarelydraw.com/comic/'
rurl = escape(url)
stripUrl = url + '%s'
firstStripUrl = stripUrl % '39'
imageSearch = compile(tagre("img", "src", r'(%scomics/\d+-\d+-\d+-[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s\d+)' % rurl))
help = 'Index format: number'
class IDreamOfAJeanieBottle(_WordPressScraper):
url = 'http://jeaniebottle.com/'
2020-03-04 06:03:14 +00:00
class InsignificantOtters(_WPWebcomic):
stripUrl = 'https://www.thedepthscomic.com/i-otters/%s/'
firstStripUrl = stripUrl % 'page-1'
url = firstStripUrl
imageSearch = '//div[contains(@class, "webcomic-media")]//img'
starter = indirectStarter
2017-05-21 23:17:05 +00:00
class InternetWebcomic(_WPNavi):
url = 'http://www.internet-webcomic.com/'
stripUrl = url + '?p=%s'
firstStripUrl = stripUrl % '30'
help = 'Index format: n'
2013-03-06 19:21:10 +00:00
class IrregularWebcomic(_BasicScraper):
url = 'http://www.irregularwebcomic.net/'
stripUrl = url + '%s.html'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '1'
2013-03-06 19:21:10 +00:00
imageSearch = compile(r'<img .*src="(.*comics/.*(png|jpg|gif))".*>')
prevSearch = compile(r'<a href="(/\d+\.html|/cgi-bin/comic\.pl\?comic=\d+)">Previous ')
help = 'Index format: nnn'
2019-06-19 08:27:06 +00:00
class IslaAukate(_ParserScraper):
url = 'https://overlordcomic.com/archive/default/latest'
stripUrl = 'https://overlordcomic.com/archive/default/pages/%s'
firstStripUrl = stripUrl % '001'
imageSearch = '//div[@id="comicpage"]/img'
prevSearch = '//nav[@class="comicnav"]/a[text()="Prev"]'
class IslaAukateColor(_ParserScraper):
url = 'https://overlordcomic.com/archive/color/latest'
stripUrl = 'https://overlordcomic.com/archive/color/pages/%s'
firstStripUrl = stripUrl % '001'
imageSearch = '//div[@id="comicpage"]/img'
prevSearch = '//nav[@class="comicnav"]/a[text()="Prev"]'
def namer(self, imageUrl, pageUrl):
# Fix filenames of early comics
filename = imageUrl.rsplit('/', 1)[-1]
if filename[0].isdigit():
filename = 'Aukate' + filename
return filename
class ItsWalky(_WordPressScraper):
url = 'http://www.itswalky.com/'