Fix SnafuComics

This commit is contained in:
Tobias Gruetzmacher 2022-06-06 13:07:48 +02:00
parent 8e1e398a8d
commit 334640515e
2 changed files with 12 additions and 14 deletions

View file

@ -1563,7 +1563,10 @@ class Removed(Scraper):
cls('SmackJeeves/ZaenWell'), cls('SmackJeeves/ZaenWell'),
cls('SmackJeeves/ZeldaTheNewAdventureofLinkIIMajorasMask'), cls('SmackJeeves/ZeldaTheNewAdventureofLinkIIMajorasMask'),
cls('SnafuComics/KOF'), cls('SnafuComics/KOF'),
cls('SnafuComics/MyPanda'),
cls('SnafuComics/SF'), cls('SnafuComics/SF'),
cls('SnafuComics/Snafu'),
cls('SnafuComics/Tin'),
cls('SnafuComics/Titan'), cls('SnafuComics/Titan'),
cls('StudioKhimera/Eorah', 'mov'), cls('StudioKhimera/Eorah', 'mov'),
cls('StuffNoOneToldMe'), cls('StuffNoOneToldMe'),

View file

@ -2,30 +2,28 @@
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam # Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2022 Tobias Gruetzmacher # Copyright (C) 2015-2022 Tobias Gruetzmacher
from ..scraper import ParserScraper import re
from ..helpers import indirectStarter
from .common import ComicControlScraper
class Snafu(ParserScraper): FILENAMECRAP = re.compile(r'_[0-9a-f]{72}(?=\.)')
# Next and Previous are swapped...
prevSearch = '//a[@class="next"]'
imageSearch = '//div[@class="comicpage"]/img'
latestSearch = '//div[@id="feed"]/a'
starter = indirectStarter
class Snafu(ComicControlScraper):
def __init__(self, name, path): def __init__(self, name, path):
super().__init__('SnafuComics/' + name) super().__init__('SnafuComics/' + name)
self.url = 'http://snafu-comics.com/swmseries/' + path self.url = 'https://snafu-comics.com/' + path
def namer(self, image_url, page_url): def namer(self, image_url, page_url):
year, month, name = image_url.rsplit('/', 3)[1:] return FILENAMECRAP.sub('', image_url.rsplit('/', 1)[-1])
return "%04s_%02s_%s" % (year, month, name)
@classmethod @classmethod
def getmodules(cls): def getmodules(cls):
return ( return (
cls('Braindead', 'braindead'), cls('Braindead', 'braindead'),
cls('Bunnywith', 'bunnywith'), cls('Bunnywith', 'bunnywith'),
cls('CrawlingCity', 'crawlingcity'),
cls('DeliverUsEvil', 'deliverusevil'), cls('DeliverUsEvil', 'deliverusevil'),
cls('EA', 'ea'), cls('EA', 'ea'),
cls('FT', 'ft'), cls('FT', 'ft'),
@ -33,18 +31,15 @@ class Snafu(ParserScraper):
cls('GrimTalesFromDownBelow', 'grimtales'), cls('GrimTalesFromDownBelow', 'grimtales'),
cls('HalfboundBlade', 'hbp'), cls('HalfboundBlade', 'hbp'),
cls('KayosGaiden', 'titan-kayos'), cls('KayosGaiden', 'titan-kayos'),
cls('MyPanda', 'mypanda'),
cls('NarutoHeroesPath', 'naruto'), cls('NarutoHeroesPath', 'naruto'),
cls('NewSuperMarioAdventures', 'nsma'), cls('NewSuperMarioAdventures', 'nsma'),
cls('PowerPuffGirls', 'powerpuffgirls'), cls('PowerPuffGirls', 'powerpuffgirls'),
cls('SatansExcrement', 'satansexcrement'), cls('SatansExcrement', 'satansexcrement'),
cls('SkullBoy', 'skullboy'), cls('SkullBoy', 'skullboy'),
cls('Snafu', 'snafu'),
cls('Soul', 'soul'), cls('Soul', 'soul'),
cls('Sugar', 'sugarbits'), cls('Sugar', 'sugarbits'),
cls('SureToBeBanD', 'stbb'), cls('SureToBeBanD', 'stbb'),
cls('TheLeague', 'league'), cls('TheLeague', 'league'),
cls('Tin', 'tin'),
cls('TrunksAndSoto', 'trunks-and-soto'), cls('TrunksAndSoto', 'trunks-and-soto'),
cls('TW', 'tw'), cls('TW', 'tw'),
cls('Zim', 'zim'), cls('Zim', 'zim'),