dosage/dosagelib/plugins/snafu.py

47 lines
1.5 KiB
Python
Raw Normal View History

# SPDX-License-Identifier: MIT
2016-10-28 22:21:41 +00:00
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
2014-01-05 15:50:57 +00:00
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2022 Tobias Gruetzmacher
2022-06-06 11:07:48 +00:00
import re
2016-04-14 21:52:35 +00:00
2022-06-06 11:07:48 +00:00
from .common import ComicControlScraper
2016-04-14 21:52:35 +00:00
2022-06-06 11:07:48 +00:00
FILENAMECRAP = re.compile(r'_[0-9a-f]{72}(?=\.)')
class Snafu(ComicControlScraper):
def __init__(self, name, path):
super().__init__('SnafuComics/' + name)
2022-06-06 11:07:48 +00:00
self.url = 'https://snafu-comics.com/' + path
2016-04-14 21:52:35 +00:00
def namer(self, image_url, page_url):
2022-06-06 11:07:48 +00:00
return FILENAMECRAP.sub('', image_url.rsplit('/', 1)[-1])
2016-04-14 21:52:35 +00:00
@classmethod
def getmodules(cls):
2021-02-01 21:02:54 +00:00
return (
cls('Braindead', 'braindead'),
cls('Bunnywith', 'bunnywith'),
2022-06-06 11:07:48 +00:00
cls('CrawlingCity', 'crawlingcity'),
cls('DeliverUsEvil', 'deliverusevil'),
cls('EA', 'ea'),
cls('FT', 'ft'),
2021-02-01 21:02:54 +00:00
cls('GG', 'gg'),
cls('GrimTalesFromDownBelow', 'grimtales'),
2021-02-01 21:02:54 +00:00
cls('HalfboundBlade', 'hbp'),
cls('KayosGaiden', 'titan-kayos'),
cls('NarutoHeroesPath', 'naruto'),
cls('NewSuperMarioAdventures', 'nsma'),
cls('PowerPuffGirls', 'powerpuffgirls'),
cls('SatansExcrement', 'satansexcrement'),
cls('SkullBoy', 'skullboy'),
cls('Soul', 'soul'),
cls('Sugar', 'sugarbits'),
cls('SureToBeBanD', 'stbb'),
cls('TheLeague', 'league'),
cls('TrunksAndSoto', 'trunks-and-soto'),
cls('TW', 'tw'),
cls('Zim', 'zim'),
2021-02-01 21:02:54 +00:00
)