2020-04-18 11:45:44 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
2016-10-28 22:21:41 +00:00
|
|
|
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
|
2016-04-01 22:14:31 +00:00
|
|
|
# Copyright (C) 2012-2014 Bastian Kleineidam
|
2022-05-28 17:33:16 +00:00
|
|
|
# Copyright (C) 2015-2022 Tobias Gruetzmacher
|
2020-01-13 06:34:05 +00:00
|
|
|
# Copyright (C) 2019-2020 Daniel Ring
|
2022-05-28 17:33:16 +00:00
|
|
|
from typing import Sequence, Union
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
from ..scraper import ParserScraper
|
2016-04-01 22:14:31 +00:00
|
|
|
|
|
|
|
# Common base classes for comics with the same structure (same hosting
|
|
|
|
# software, for example) go here. Since those are shared by many modules,
|
|
|
|
# please don't use lists of expression, as that makes it hard to track which
|
|
|
|
# expression is for which comics.
|
2022-06-06 10:08:32 +00:00
|
|
|
__all__ = (
|
|
|
|
'ComicControlScraper',
|
|
|
|
'WordPressNavi',
|
|
|
|
'WordPressNaviIn',
|
|
|
|
'WordPressScraper',
|
|
|
|
'WordPressSpliced',
|
|
|
|
'WordPressWebcomic',
|
|
|
|
)
|
2016-04-01 22:14:31 +00:00
|
|
|
|
2016-04-10 21:04:34 +00:00
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class ComicControlScraper(ParserScraper):
|
|
|
|
imageSearch: Union[Sequence[str], str] = '//img[@id="cc-comic"]'
|
|
|
|
prevSearch = '//a[@rel="prev"]'
|
|
|
|
nextSearch = '//a[@rel="next"]'
|
|
|
|
latestSearch = '//a[@rel="last"]'
|
|
|
|
|
|
|
|
|
|
|
|
class WordPressScraper(ParserScraper):
|
2016-04-01 22:14:31 +00:00
|
|
|
imageSearch = '//div[@id="comic"]//img'
|
2020-07-31 20:56:30 +00:00
|
|
|
prevSearch = '//a[d:class("comic-nav-previous")]'
|
|
|
|
nextSearch = '//a[d:class("comic-nav-next")]'
|
|
|
|
latestSearch = '//a[d:class("comic-nav-last")]'
|
2017-05-21 23:17:05 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class WordPressSpliced(ParserScraper):
|
2021-01-21 07:53:38 +00:00
|
|
|
imageSearch = '//div[@id="one-comic-option"]//img'
|
2021-01-18 00:25:03 +00:00
|
|
|
prevSearch = '//a[d:class("previous-comic")]'
|
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class WordPressNavi(WordPressScraper):
|
2020-07-31 20:56:30 +00:00
|
|
|
prevSearch = '//a[d:class("navi-prev")]'
|
2016-04-01 22:14:31 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class WordPressNaviIn(WordPressScraper):
|
2020-07-31 20:56:30 +00:00
|
|
|
prevSearch = '//a[d:class("navi-prev-in")]'
|
2016-05-01 23:25:34 +00:00
|
|
|
|
|
|
|
|
2022-06-06 10:08:32 +00:00
|
|
|
class WordPressWebcomic(ParserScraper):
|
2020-07-31 20:56:30 +00:00
|
|
|
imageSearch = '//div[d:class("webcomic-image")]//img'
|
|
|
|
prevSearch = '//a[d:class("previous-webcomic-link")]'
|
|
|
|
nextSearch = '///a[d:class("next-webcomic-link")]'
|
|
|
|
latestSearch = '//a[d:class("last-webcomic-link")]'
|