[tcbscans] support other domains

This commit is contained in:
enduser420
2024-06-21 21:29:11 +05:30
parent f58b0e6fc7
commit 5adbfe526d
2 changed files with 38 additions and 6 deletions

View File

@@ -4,19 +4,23 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
"""Extractors for https://tcbscans.com/"""
"""Extractors for https://tcbscans.me/"""
from .common import ChapterExtractor, MangaExtractor
from .. import text
BASE_PATTERN = r"(?:https?://)?(?:tcbscans|onepiecechapters)\.com"
BASE_PATTERN = (r"(?:https?://)?(?:tcb(?:-backup\.bihar-mirchi|scans)"
r"|onepiecechapters)\.(?:com|me)")
class TcbscansChapterExtractor(ChapterExtractor):
category = "tcbscans"
root = "https://tcbscans.com"
pattern = BASE_PATTERN + r"(/chapters/\d+/[^/?#]+)"
example = "https://tcbscans.com/chapters/12345/MANGA-chapter-123"
example = "https://tcbscans.me/chapters/12345/MANGA-chapter-123"
def __init__(self, match):
self.root = text.root_from_url(match.group(0))
ChapterExtractor.__init__(self, match)
def images(self, page):
return [
@@ -39,10 +43,13 @@ class TcbscansChapterExtractor(ChapterExtractor):
class TcbscansMangaExtractor(MangaExtractor):
category = "tcbscans"
root = "https://tcbscans.com"
chapterclass = TcbscansChapterExtractor
pattern = BASE_PATTERN + r"(/mangas/\d+/[^/?#]+)"
example = "https://tcbscans.com/mangas/123/MANGA"
example = "https://tcbscans.me/mangas/123/MANGA"
def __init__(self, match):
self.root = text.root_from_url(match.group(0))
MangaExtractor.__init__(self, match)
def chapters(self, page):
data = {