2020-04-18 11:45:44 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
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
|
2020-01-09 16:38:13 +00:00
|
|
|
# Copyright (C) 2015-2020 Tobias Gruetzmacher
|
2020-01-13 06:34:05 +00:00
|
|
|
# Copyright (C) 2019-2020 Daniel Ring
|
2023-06-08 06:32:40 +00:00
|
|
|
import json
|
2020-02-04 00:06:19 +00:00
|
|
|
from re import compile
|
2021-10-12 04:55:10 +00:00
|
|
|
from urllib.parse import urljoin
|
|
|
|
from lxml import etree
|
2012-06-20 19:58:13 +00:00
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
from ..scraper import BasicScraper, ParserScraper
|
2020-07-31 20:56:30 +00:00
|
|
|
from ..helpers import indirectStarter
|
2016-03-31 21:13:54 +00:00
|
|
|
from ..util import tagre
|
2022-06-06 10:08:32 +00:00
|
|
|
from .common import ComicControlScraper, WordPressScraper, WordPressNavi
|
2016-03-31 21:13:54 +00:00
|
|
|
|
2012-11-20 17:53:53 +00:00
|
|
|
|
2023-06-08 06:32:40 +00:00
|
|
|
class UberQuest(ParserScraper):
|
|
|
|
baseUrl = 'https://uberquest.studiokhimera.com/'
|
|
|
|
url = baseUrl + 'wp-json/keeros_comics/v1/chapters'
|
|
|
|
stripUrl = baseUrl + 'wp-json/wp/v2/cfx_comic_page?page_number=%s'
|
|
|
|
firstStripUrl = stripUrl % 'cover'
|
|
|
|
|
|
|
|
def starter(self):
|
|
|
|
# Retrieve comic metadata from API
|
|
|
|
data = self.session.get(self.url)
|
|
|
|
data.raise_for_status()
|
|
|
|
return self.stripUrl % data.json()[-1]['pages'][-1]['page_number']
|
|
|
|
|
|
|
|
def getPrevUrl(self, url, data):
|
|
|
|
return self.stripUrl % json.loads(data.text_content())[0]['prev_id']
|
|
|
|
|
|
|
|
def fetchUrls(self, url, data, urlSearch):
|
|
|
|
return [json.loads(data.text_content())[0]['attachment']]
|
|
|
|
|
|
|
|
def namer(self, imageUrl, pageUrl):
|
|
|
|
return 'UberQuest-' + pageUrl.rsplit('=', 1)[-1]
|
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class Underling(WordPressNavi):
|
2020-01-09 16:38:13 +00:00
|
|
|
url = ('https://web.archive.org/web/20190806120425/'
|
|
|
|
'http://underlingcomic.com/')
|
2016-04-10 21:04:34 +00:00
|
|
|
firstStripUrl = url + 'page-one/'
|
2020-01-09 16:38:13 +00:00
|
|
|
endOfLife = True
|
2014-02-20 11:54:40 +00:00
|
|
|
|
2012-11-20 17:53:53 +00:00
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class Undertow(BasicScraper):
|
2013-02-04 20:00:26 +00:00
|
|
|
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')
|
2016-04-12 21:11:39 +00:00
|
|
|
latestSearch = compile(r'href="(.+?)".+?Most recent page')
|
2016-04-13 18:01:51 +00:00
|
|
|
starter = indirectStarter
|
2012-06-20 19:58:13 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class unDivine(ComicControlScraper):
|
2021-04-25 01:35:21 +00:00
|
|
|
url = 'https://www.undivinecomic.com/'
|
|
|
|
stripUrl = url + 'comic/%s'
|
|
|
|
firstStripUrl = stripUrl % 'page-1'
|
|
|
|
|
|
|
|
def namer(self, imageUrl, pageUrl):
|
|
|
|
# Fix inconsistent filenames
|
|
|
|
filename = imageUrl.rsplit('/', 1)[-1].replace(' ', '-')
|
|
|
|
filename = filename.replace('10B311D9-0992-4D74-AEB8-DAB714DA67C6', 'UD-322')
|
|
|
|
filename = filename.replace('99266624-7EF7-4E99-9EC9-DDB5F59CBDFD', 'UD-311')
|
|
|
|
filename = filename.replace('33C6A5A1-F703-4A0A-BCD5-DE1A09359D8E', 'UD-310')
|
|
|
|
filename = filename.replace('6CE01E81-C299-43C7-A221-8DE0670EFA30', 'ch4endbonusq4')
|
|
|
|
filename = filename.replace('DB66D93B-1FE5-49C7-90E0-FFF981DCD6B3', 'bipolar')
|
|
|
|
if len(filename) > 15 and filename[0].isdigit() and filename[10] == '-':
|
|
|
|
filename = filename[11:]
|
|
|
|
return filename
|
2020-01-08 23:17:07 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +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'
|
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +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')
|
2021-10-12 04:55:10 +00:00
|
|
|
imageSearch = '//div[@id="comic"]//img'
|
2020-07-31 20:56:30 +00:00
|
|
|
prevSearch = '//a[d:class("back")]'
|
2020-01-09 21:21:20 +00:00
|
|
|
latestSearch = '//div[@id="chapter_box"][1]//a[last()]'
|
|
|
|
multipleImagesPerStrip = True
|
2016-04-13 18:01:51 +00:00
|
|
|
starter = indirectStarter
|
2020-01-09 21:21:20 +00:00
|
|
|
help = 'Index format: chapter-page'
|
|
|
|
|
2021-10-12 04:55:10 +00:00
|
|
|
def fetchUrls(self, url, data, urlSearch):
|
|
|
|
imageUrls = super(Unsounded, self).fetchUrls(url, data, urlSearch)
|
|
|
|
# Include background for multi-image pages
|
|
|
|
imageRegex = compile(r'background-image: url\((pageart/.*)\)')
|
|
|
|
for match in imageRegex.finditer(str(etree.tostring(data))):
|
|
|
|
print(match)
|
|
|
|
searchUrls.append(normaliseURL(urljoin(data[1], match.group(1))))
|
|
|
|
return imageUrls
|
|
|
|
|
|
|
|
def namer(self, imageUrl, pageUrl):
|
|
|
|
filename = imageUrl.rsplit('/', 1)[-1]
|
|
|
|
pagename = pageUrl.rsplit('/', 1)[-1]
|
|
|
|
if pagename.split('.', 1)[0] != filename.split('.', 1)[0]:
|
|
|
|
filename = pagename.split('_', 1)[0] + '_' + filename
|
|
|
|
return filename
|
|
|
|
|
2020-01-09 21:21:20 +00:00
|
|
|
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):
|
|
|
|
chapter, num = index.split('-')
|
|
|
|
return self.stripUrl % (chapter, chapter, num)
|
2016-05-16 21:55:41 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class UrgentTransformationCrisis(WordPressScraper):
|
2016-05-16 21:55:41 +00:00
|
|
|
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')
|