Fix UberQuest

This commit is contained in:
Techwolf 2023-06-07 23:32:40 -07:00 committed by Tobias Gruetzmacher
parent 4965e0ce09
commit e9b48cfd58
No known key found for this signature in database
3 changed files with 24 additions and 18 deletions

View file

@ -1679,6 +1679,7 @@ class Renamed(Scraper):
cls('SmackJeeves/TheRealmOfKaerwyn', 'ComicFury/TheRealmOfKaerwyn'),
cls('SoloLeveling', 'MangaDex/SoloLeveling'),
cls('StudioKhimera/Draconia', 'Draconia'),
cls('StudioKhimera/UberQuest', 'UberQuest'),
cls('TracesOfThePast', 'RickGriffinStudios/TracesOfThePast'),
cls('TracesOfThePast/NSFW', 'RickGriffinStudios/TracesOfThePastNSFW'),

View file

@ -45,21 +45,3 @@ class StudioKhimera(ParserScraper):
return (
cls('Mousechievous', 'mousechievous'),
)
class UberQuest(WordPressScraper):
name = 'StudioKhimera/UberQuest'
stripUrl = 'https://uberquest.studiokhimera.com/comic/page/%s/'
url = stripUrl % 'latest'
firstStripUrl = stripUrl % 'cover'
imageSearch = '//div[@class="prj--comic-image"]/img'
prevSearch = '//uq-image-button[d:class("prj--comic-control-prev")]'
def namer(self, imageUrl, pageUrl):
# Fix inconsistent filenames
filename = imageUrl.rsplit('/', 1)[-1]
filename = filename.replace('Page', 'UberQuest')
filename = filename.replace('UberQuest01.', 'UberQuest001.')
filename = filename.replace('UberQuest98.', 'UberQuest098.')
filename = filename.replace('UberQuest99.', 'UberQuest099.')
return filename

View file

@ -3,6 +3,7 @@
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2020 Tobias Gruetzmacher
# Copyright (C) 2019-2020 Daniel Ring
import json
from re import compile
from urllib.parse import urljoin
from lxml import etree
@ -13,6 +14,28 @@ from ..util import tagre
from .common import ComicControlScraper, WordPressScraper, WordPressNavi
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]
class Underling(WordPressNavi):
url = ('https://web.archive.org/web/20190806120425/'
'http://underlingcomic.com/')