2020-04-18 11:45:44 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
2023-06-03 15:51:16 +00:00
|
|
|
# SPDX-FileCopyrightText: © 2019 Tobias Gruetzmacher
|
|
|
|
# SPDX-FileCopyrightText: © 2019 Thomas W. Littauer
|
2024-03-17 18:18:35 +00:00
|
|
|
from urllib.parse import parse_qs, urlsplit
|
|
|
|
|
|
|
|
from ..helpers import indirectStarter
|
2022-06-06 10:08:32 +00:00
|
|
|
from ..scraper import ParserScraper
|
2019-12-16 22:18:04 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class ComicsKingdom(ParserScraper):
|
2024-03-17 18:18:35 +00:00
|
|
|
partDiv = '//div[d:class("comic-reader-item")]'
|
|
|
|
imageSearch = partDiv + '[1]//a[contains(@href, "/custom-framed-print/")]'
|
|
|
|
prevSearch = partDiv + '[2]/@data-link'
|
|
|
|
starter = indirectStarter
|
2019-12-16 22:18:04 +00:00
|
|
|
help = 'Index format: yyyy-mm-dd'
|
|
|
|
|
2022-06-05 22:20:12 +00:00
|
|
|
def __init__(self, name, path, lang=None):
|
2022-02-14 23:24:15 +00:00
|
|
|
super().__init__('ComicsKingdom/' + name)
|
2022-02-14 21:24:12 +00:00
|
|
|
self.url = 'https://comicskingdom.com/' + path
|
2019-12-16 22:47:14 +00:00
|
|
|
self.stripUrl = self.url + '/%s'
|
2024-05-12 11:44:53 +00:00
|
|
|
self.latestSearch = f'//a[re:test(@href, "/{path}/[0-9-]+$")]'
|
2022-06-05 22:20:12 +00:00
|
|
|
if lang:
|
|
|
|
self.lang = lang
|
2019-12-16 22:47:14 +00:00
|
|
|
|
2024-03-17 18:18:35 +00:00
|
|
|
def imageUrlModifier(self, url, data):
|
|
|
|
"""Extract high-quality image URL from link"""
|
|
|
|
return parse_qs(urlsplit(url).query)['img'][0]
|
|
|
|
|
|
|
|
def link_modifier(self, fromurl, tourl):
|
|
|
|
return tourl.replace('//wp.', '//', 1)
|
|
|
|
|
2019-12-16 22:18:04 +00:00
|
|
|
@classmethod
|
2022-12-11 19:15:09 +00:00
|
|
|
def getmodules(cls): # noqa: CFQ001
|
2019-12-16 22:18:04 +00:00
|
|
|
return (
|
|
|
|
# do not edit anything below since these entries are generated from
|
|
|
|
# scripts/comicskingdom.py
|
|
|
|
# START AUTOUPDATE
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('Alice', 'alice'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('Apartment3G', 'apartment-3-g_1'),
|
|
|
|
cls('ArcticCircle', 'arctic-circle'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('ATodaVelocidadSpanish', 'a-toda-velocidad', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('BarneyGoogleAndSnuffySmith', 'barney-google-and-snuffy-smith'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('BarneyGoogleAndSnuffySmithSpanish', 'tapon', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('BeetleBailey', 'beetle-bailey-1'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('BeetleBaileySpanish', 'beto-el-recluta', lang='es'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('BeetleMoses', 'beetle-moses'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('BetweenFriends', 'between-friends'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('BewareOfToddler', 'beware-of-toddler'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('BigBenBolt', 'big-ben-bolt'),
|
|
|
|
cls('Bizarro', 'bizarro'),
|
|
|
|
cls('Blondie', 'blondie'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('BlondieSpanish', 'pepita', lang='es'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('BobMankoffPresentsShowMeTheFunny', 'show-me-the-funny'),
|
|
|
|
cls('BobMankoffPresentsShowMeTheFunnyAnimalEdition', 'show-me-the-funny-pets'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('BonersArk', 'boners-ark'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('BreakOfDay', 'break-of-day'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('BrickBradford', 'brick-bradford'),
|
|
|
|
cls('BrilliantMindOfEdisonLee', 'brilliant-mind-of-edison-lee'),
|
|
|
|
cls('BringingUpFather', 'bringing-up-father'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('BringingUpFatherSpanish', 'educando-a-papa', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('BuzSawyer', 'buz-sawyer'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('Candorville', 'candorville'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('CarpeDiem', 'carpe-diem'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('Comiclicious', 'comiclicious'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('Crock', 'crock'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('CrockSpanish', 'crock-spanish', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('Curtis', 'curtis'),
|
|
|
|
cls('DaddyDaze', 'daddy-daze'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('DarrinBell', 'darrin-bell'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('DavidMHitch', 'david-m-hitch'),
|
|
|
|
cls('DennisTheMenace', 'dennis-the-menace'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('DennisTheMenaceSpanish', 'daniel-el-travieso', lang='es'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('Dumplings', 'dumplings'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('Dustin', 'dustin'),
|
|
|
|
cls('EdGamble', 'ed-gamble'),
|
2022-06-05 22:20:12 +00:00
|
|
|
# EdgeCity has a duplicate in GoComics/EdgeCity
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('FamilyCircus', 'family-circus'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('FamilyCircusSpanish', 'circulo-familiar', lang='es'),
|
|
|
|
cls('FlashForward', 'flash-forward'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('FlashGordon', 'flash-gordon'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('FunnyOnlineAnimals', 'funny-online-animals'),
|
|
|
|
cls('GearheadGertie', 'gearhead-gertie'),
|
|
|
|
cls('GodsHands', 'gods-hands'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('HagarTheHorrible', 'hagar-the-horrible'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('HagarTheHorribleSpanish', 'olafo', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('HeartOfJulietJones', 'heart-of-juliet-jones'),
|
|
|
|
cls('HiAndLois', 'hi-and-lois'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('InsanityStreak', 'insanity-streak'),
|
|
|
|
cls('IntelligentLife', 'intelligent'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('JimmyMargulies', 'jimmy-margulies'),
|
|
|
|
cls('JohnBranch', 'john-branch'),
|
|
|
|
cls('JohnnyHazard', 'johnny-hazard'),
|
|
|
|
cls('JudgeParker', 'judge-parker'),
|
|
|
|
cls('JungleJimSundays', 'jungle-jim-sundays'),
|
|
|
|
cls('KatzenjammerKids', 'katzenjammer-kids'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('KatzenjammerKidsSpanish', 'maldades-de-dos-pilluelos', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('KevinAndKell', 'kevin-and-kell'),
|
|
|
|
cls('KingOfTheRoyalMounted', 'king-of-the-royal-mounted'),
|
|
|
|
cls('KirkWalters', 'kirk-walters'),
|
|
|
|
cls('KrazyKat', 'krazy-kat'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('LaloYLolaSpanish', 'lalo-y-lola', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('LeeJudge', 'lee-judge'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('LegalizationNation', 'legalization-nation'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('LegendOfBill', 'legend-of-bill'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('LittleIodineSundays', 'little-iodine-sundays'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('LittleKing', 'the-little-king'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('Macanudo', 'macanudo'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('MacanudoSpanish', 'macanudo-spanish', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('MallardFillmore', 'mallard-fillmore'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('MandrakeTheMagician', 'mandrake-the-magician'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('MandrakeTheMagicianSpanish', 'mandrake-the-magician-spanish', lang='es'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('MaraLlaveKeeperOfTime', 'mara-llave-keeper-of-time'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('MarkTrail', 'mark-trail'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('MarkTrailSpanish', 'mark-trail-spanish', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('Marvin', 'marvin'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('MarvinSpanish', 'marvin-spanish', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('MaryWorth', 'mary-worth'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('MaryWorthSpanish', 'maria-de-oro', lang='es'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('Mazetoons', 'mazetoons'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('MikeShelton', 'mike-shelton'),
|
|
|
|
cls('MikeSmith', 'mike-smith'),
|
|
|
|
cls('MooseAndMolly', 'moose-and-molly'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('MooseAndMollySpanish', 'quintin', lang='es'),
|
|
|
|
cls('MrAbernathySpanish', 'don-abundio', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('Mutts', 'mutts'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('MuttsSpanish', 'motas', lang='es'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('NeverBeenDeader', 'never-been-deader'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('OfficeHours', 'office-hours'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('OliveAndPopeye', 'olive-popeye'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('OnTheFastrack', 'on-the-fastrack'),
|
|
|
|
cls('PajamaDiaries', 'pajama-diaries'),
|
|
|
|
cls('PardonMyPlanet', 'pardon-my-planet'),
|
|
|
|
cls('Phantom', 'phantom'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('PhantomSpanish', 'el-fantasma', lang='es'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('PlanetSyndicate', 'the_planet_syndicate'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('Popeye', 'popeye'),
|
|
|
|
cls('PopeyesCartoonClub', 'popeyes-cartoon-club'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('PopeyeSpanish', 'popeye-spanish', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('PrinceValiant', 'prince-valiant'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('PrincipeValienteSpanish', 'principe-valiente', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('ProsAndCons', 'pros-cons'),
|
|
|
|
cls('Quincy', 'quincy'),
|
|
|
|
cls('RadioPatrol', 'radio-patrol'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('RaeTheDoe', 'rae-the-doe'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('RexMorganMD', 'rex-morgan-m-d'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('RexMorganMDSpanish', 'rex-morgan-md-spanish', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('RhymesWithOrange', 'rhymes-with-orange'),
|
|
|
|
cls('RipKirby', 'rip-kirby'),
|
2024-03-17 18:18:35 +00:00
|
|
|
# Rosebuds has a duplicate in GoComics/Rosebuds
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('SafeHavens', 'safe-havens'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('SagaOfBrannBjornson', 'the-saga-of-brann-bjornson'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('Sales', 'sales'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('SallyForth', 'sally-forth'),
|
|
|
|
cls('SamAndSilo', 'sam-and-silo'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('SamAndSiloSpanish', 'soso-y-siso', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('SecretAgentX9', 'secret-agent-x-9'),
|
|
|
|
# Shoe has a duplicate in GoComics/Shoe
|
|
|
|
cls('SixChix', 'six-chix'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('SlylockFox', 'slylock-fox-and-comics-for-kids'),
|
|
|
|
cls('SlylockFoxSpanish', 'solo-para-ninos', lang='es'),
|
|
|
|
cls('SuburbanFairyTales', 'suburban-fairy-tales'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('TakeItFromTheTinkersons', 'take-it-from-the-tinkersons'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('TheyllDoItEveryTimeSpanish', 'nunca-falta-alguien-asi', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('ThimbleTheater', 'thimble-theater'),
|
|
|
|
cls('Tiger', 'tiger'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('TigerSpanish', 'tigrillo', lang='es'),
|
|
|
|
cls('TinasGroove', 'tina-s-groove'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('ToddTheDinosaur', 'todd-the-dinosaur'),
|
2024-03-17 18:18:35 +00:00
|
|
|
cls('WillyBlack', 'willy-black'),
|
|
|
|
cls('WillyBlacksSpanish', 'willy-black-spanish', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('ZippyThePinhead', 'zippy-the-pinhead'),
|
|
|
|
cls('Zits', 'zits'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('ZitsSpanish', 'jeremias', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
# END AUTOUPDATE
|
|
|
|
)
|