2020-04-18 11:45:44 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
2024-03-17 20:44:46 +00:00
|
|
|
# SPDX-FileCopyrightText: © 2019 Tobias Gruetzmacher
|
|
|
|
# SPDX-FileCopyrightText: © 2019 Daniel Ring
|
2024-07-20 16:36:21 +00:00
|
|
|
import itertools
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
from ..scraper import ParserScraper
|
2024-07-20 16:36:21 +00:00
|
|
|
from ..helpers import indirectStarter, joinPathPartsNamer
|
2020-01-11 10:13:28 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class Derideal(ParserScraper):
|
2024-07-20 16:36:21 +00:00
|
|
|
baseUrl = 'https://derideal.com/'
|
|
|
|
imageSearch = '//img[d:class("comic-page") or d:class("comic-pag")]'
|
|
|
|
prevSearch = '//a[text()="<"]'
|
|
|
|
starter = indirectStarter
|
|
|
|
namer = joinPathPartsNamer(imageparts=range(-3, 0))
|
|
|
|
|
|
|
|
def __init__(self, name, lang, sub, first, eol=False, multi=False):
|
|
|
|
if lang == 'en':
|
|
|
|
base = 'Derideal'
|
|
|
|
lateststr = 'Read latest update'
|
2020-01-11 10:13:28 +00:00
|
|
|
else:
|
2024-07-20 16:36:21 +00:00
|
|
|
base = 'DeridealSpanish'
|
|
|
|
sub = f'{lang}/{sub}'
|
|
|
|
lateststr = 'Leer última actualización'
|
2020-01-11 10:13:28 +00:00
|
|
|
|
2024-07-20 16:36:21 +00:00
|
|
|
if not name:
|
|
|
|
super().__init__(base)
|
|
|
|
else:
|
|
|
|
super().__init__(f'{base}/{name}')
|
2020-01-11 10:13:28 +00:00
|
|
|
|
2024-07-20 16:36:21 +00:00
|
|
|
self.url = f'{self.baseUrl}{sub}'
|
|
|
|
self.firstStripUrl = f'{self.url}/{first}/'
|
|
|
|
self.latestSearch = f'//a[contains(text(), "{lateststr}")]'
|
|
|
|
self.lang = lang
|
|
|
|
self.endOfLife = eol
|
|
|
|
self.multipleImagesPerStrip = multi
|
2020-01-11 10:13:28 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def getmodules(cls):
|
2024-07-20 16:36:21 +00:00
|
|
|
return itertools.chain.from_iterable((
|
|
|
|
cls('', lang, 'derideal', 'chimeras-cover'),
|
|
|
|
cls('Legacy', lang, 'derideal-legacy', 'the-dream-cover', eol=True),
|
|
|
|
cls('LostMemories', lang, 'lost-memories', 'lost-memories-pixi', multi=True),
|
|
|
|
cls('Nova', lang, 'nova', 'xen-prelude-cover'),
|
|
|
|
cls('ProjectPrime', lang, 'project-prime', 'custus-part-i-cover'),
|
|
|
|
cls('PurpurinaEffect', lang, 'purpurina-effect', 'purpurina-effect-cover'),
|
|
|
|
cls('RLE', lang, 'RLE', 'the-leyend-of-the-rose-cover'),
|
|
|
|
cls('TheVoid', lang, 'the-void', 'the-void-cover'),
|
|
|
|
) for lang in ('en', 'es'))
|