dosage/dosagelib/plugins/u.py

78 lines
2.7 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
2012-11-21 20:57:26 +00:00
from __future__ import absolute_import, division, print_function
2013-04-25 19:38:18 +00:00
from re import compile, escape
2012-06-20 19:58:13 +00:00
2019-06-22 06:13:25 +00:00
from ..scraper import _BasicScraper, _ParserScraper
2020-01-09 21:21:20 +00:00
from ..helpers import indirectStarter, xpath_class
from ..util import tagre
from .common import _ComicControlScraper, _WordPressScraper, _WPNavi
2017-05-21 23:17:05 +00:00
class Underling(_WPNavi):
url = ('https://web.archive.org/web/20190806120425/'
'http://underlingcomic.com/')
firstStripUrl = url + 'page-one/'
endOfLife = True
2014-02-20 11:54:40 +00:00
2012-06-20 19:58:13 +00:00
class Undertow(_BasicScraper):
url = 'http://undertow.dreamshards.org/'
2012-12-04 06:02:40 +00:00
imageSearch = compile(tagre("img", "src", r'([^"]+\.jpg)'))
2012-06-20 19:58:13 +00:00
prevSearch = compile(r'href="(.+?)".+?teynpoint')
latestSearch = compile(r'href="(.+?)".+?Most recent page')
starter = indirectStarter
2012-06-20 19:58:13 +00:00
class unDivine(_ComicControlScraper):
url = 'http://undivinecomic.com/'
2012-06-20 19:58:13 +00:00
class UnicornJelly(_BasicScraper):
2013-04-13 18:58:00 +00:00
baseUrl = 'http://unicornjelly.com/'
url = baseUrl + 'uni666.html'
stripUrl = baseUrl + 'uni%s.html'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '001'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'</TABLE>(?:<FONT COLOR="BLACK">)?<IMG SRC="(images/[^"]+)" WIDTH=')
prevSearch = compile(r'<A HREF="(uni\d{3}[bcs]?\.html)">(<FONT COLOR="BLACK">)?<IMG SRC="images/back00\.gif"')
help = 'Index format: nnn'
2020-01-09 21:21:20 +00:00
class Unsounded(_ParserScraper):
2013-04-25 19:38:18 +00:00
url = 'http://www.casualvillain.com/Unsounded/'
2020-01-09 21:21:20 +00:00
startUrl = url + 'comic+index/'
2013-04-25 19:38:18 +00:00
stripUrl = url + 'comic/ch%s/ch%s_%s.html'
firstStripUrl = stripUrl % ('01', '01', '01')
2020-01-09 21:21:20 +00:00
imageSearch = '//img[contains(@src, "/pageart/ch")]'
prevSearch = '//a[{}]'.format(xpath_class('back'))
latestSearch = '//div[@id="chapter_box"][1]//a[last()]'
multipleImagesPerStrip = True
starter = indirectStarter
2020-01-09 21:21:20 +00:00
help = 'Index format: chapter-page'
def getPrevUrl(self, url, data):
# Fix missing navigation links between chapters
if 'ch13/you_let_me_fall' in url:
return self.stripUrl % ('13', '13', '85')
return super(Unsounded, self).getPrevUrl(url, data)
2013-04-25 19:38:18 +00:00
def getIndexStripUrl(self, index):
"""Get comic strip URL from index."""
chapter, num = index.split('-')
return self.stripUrl % (chapter, chapter, num)
2016-05-16 21:55:41 +00:00
class UrgentTransformationCrisis(_WordPressScraper):
url = 'http://www.catomix.com/utc/'
firstStripUrl = url + 'comic/cover1'
2019-07-06 05:23:37 +00:00
def namer(self, imageUrl, pageUrl):
# Fix inconsistent filenames
filename = imageUrl.rsplit('/', 1)[-1].rsplit('?', 1)[0]
return filename.replace('FVLYHD', 'LYHDpage').replace('UTC084web', '20091218c')