2020-04-18 11:45:44 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
2022-02-14 21:24:12 +00:00
|
|
|
# Copyright (C) 2019-2022 Tobias Gruetzmacher
|
2019-12-16 22:18:04 +00:00
|
|
|
# Copyright (C) 2019 Thomas W. Littauer
|
2022-02-14 21:24:12 +00:00
|
|
|
from importlib.resources import path as get_path
|
|
|
|
|
2019-12-16 22:47:14 +00:00
|
|
|
from ..helpers import bounceStarter, joinPathPartsNamer
|
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):
|
2022-03-20 20:22:42 +00:00
|
|
|
imageSearch = '//img[@id="theComicImage"]'
|
2022-02-14 23:24:15 +00:00
|
|
|
prevSearch = '//a[./img[contains(@alt, "Previous")]]'
|
|
|
|
nextSearch = '//a[./img[contains(@alt, "Next")]]'
|
2019-12-16 22:47:14 +00:00
|
|
|
starter = bounceStarter
|
|
|
|
namer = joinPathPartsNamer((-2, -1), ())
|
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'
|
2022-06-05 22:20:12 +00:00
|
|
|
if lang:
|
|
|
|
self.lang = lang
|
2019-12-16 22:47:14 +00:00
|
|
|
|
2022-02-14 23:18:48 +00:00
|
|
|
# slightly iffy hack taken from certifi
|
|
|
|
# We need or own certificate bundle since ComicsKingdom screws up their
|
|
|
|
# TLS setup from time to time, this should "fix" it)
|
|
|
|
self.cert_ctx = get_path('dosagelib.data', 'godaddy-bundle-g2-2031.pem')
|
|
|
|
self.session.add_host_options('comicskingdom.com', {
|
|
|
|
'verify': str(self.cert_ctx.__enter__()),
|
|
|
|
})
|
|
|
|
|
2019-12-16 22:18:04 +00:00
|
|
|
@classmethod
|
2020-10-11 18:15:27 +00:00
|
|
|
def getmodules(cls): # noqa: Allowed to be long
|
2019-12-16 22:18:04 +00:00
|
|
|
return (
|
|
|
|
# Some comics are not listed on the "all" page (too old?)
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('Retail', 'retail'),
|
2019-12-16 22:47:14 +00:00
|
|
|
|
2019-12-16 22:18:04 +00:00
|
|
|
# do not edit anything below since these entries are generated from
|
|
|
|
# scripts/comicskingdom.py
|
|
|
|
# START AUTOUPDATE
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('AmazingSpiderman', 'amazing-spider-man'),
|
|
|
|
cls('AmazingSpidermanSpanish', 'hombre-arana', lang='es'),
|
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'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('BetweenFriends', 'between-friends'),
|
|
|
|
cls('BigBenBolt', 'big-ben-bolt'),
|
|
|
|
cls('BigBenBoltSundays', 'big-ben-bolt-sundays'),
|
|
|
|
cls('Bizarro', 'bizarro'),
|
|
|
|
cls('Blondie', 'blondie'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('BlondieSpanish', 'pepita', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('BonersArk', 'boners-ark'),
|
|
|
|
cls('BonersArkSundays', 'boners-ark-sundays'),
|
|
|
|
cls('BrianDuffy', 'brian-duffy'),
|
|
|
|
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'),
|
|
|
|
cls('CarpeDiem', 'carpe-diem'),
|
|
|
|
cls('Crankshaft', 'crankshaft'),
|
|
|
|
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'),
|
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'),
|
|
|
|
cls('FlashGordonSundays', 'flash-gordon-sundays'),
|
|
|
|
cls('FunkyWinkerbean', 'funky-winkerbean'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('FunkyWinkerbeanSunday', 'funky-winkerbean-sundays'),
|
|
|
|
cls('FunkyWinkerbeanVintage', 'funky-winkerbean-1'),
|
|
|
|
cls('FunnyOnlineAnimals', 'Funny-Online-Animals'),
|
|
|
|
cls('GearheadGertie', 'Gearhead-Gertie'),
|
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('HeartOfJulietJonesSundays', 'heart-of-juliet-jones-sundays'),
|
|
|
|
cls('HiAndLois', 'hi-and-lois'),
|
|
|
|
cls('IntelligentLife', 'Intelligent'),
|
|
|
|
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('KatzenjammerKidsSundays', 'katzenjammer-kids-sundays'),
|
|
|
|
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'),
|
|
|
|
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'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('Lockhorns', 'lockhorns'),
|
|
|
|
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'),
|
|
|
|
cls('MandrakeTheMagician', 'mandrake-the-magician-1'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('MandrakeTheMagicianSpanish', 'mandrake-the-magician-spanish', lang='es'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('MandrakeTheMagicianSundays', 'mandrake-the-magician-sundays'),
|
|
|
|
cls('MarkTrail', 'mark-trail'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('MarkTrailSpanish', 'mark-trail-spanish', lang='es'),
|
|
|
|
cls('MarkTrailVintage', 'Mark-Trail-Vintage'),
|
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'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('MikePeters', 'mike-peters'),
|
|
|
|
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'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('MotherGooseAndGrimm', 'mother-goose-grimm'),
|
2022-06-05 22:20:12 +00:00
|
|
|
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'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('OfficeHours', 'office-hours'),
|
|
|
|
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'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('PhantomSundays', 'phantom-sundays'),
|
|
|
|
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('PrinceValiantSundays', 'prince-valiant-sundays'),
|
|
|
|
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'),
|
|
|
|
cls('SafeHavens', 'safe-havens'),
|
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'),
|
|
|
|
cls('SlylockFoxAndComicsForKids', 'slylock-fox-and-comics-for-kids'),
|
2022-06-05 22:20:12 +00:00
|
|
|
cls('SlylockFoxAndComicsForKidsSpanish', 'solo-para-ninos', lang='es'),
|
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('TigerVintage', 'tiger-1'),
|
|
|
|
cls('TigerVintageSundays', 'tiger-sundays'),
|
|
|
|
cls('TinasGroove', 'tina-s-groove'),
|
2019-12-16 22:18:04 +00:00
|
|
|
cls('ToddTheDinosaur', 'todd-the-dinosaur'),
|
|
|
|
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
|
|
|
|
)
|