From 887ade30a51edeea150fd1a95b33c86208319289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 9 Jan 2024 18:02:49 +0100 Subject: [PATCH] [batoto] support more mirror domains (#5042) --- gallery_dl/extractor/batoto.py | 7 +- test/results/batoto.py | 140 +++++++++++++++++++++++++++++---- 2 files changed, 128 insertions(+), 19 deletions(-) diff --git a/gallery_dl/extractor/batoto.py b/gallery_dl/extractor/batoto.py index 72b5b6e5..e82cd09f 100644 --- a/gallery_dl/extractor/batoto.py +++ b/gallery_dl/extractor/batoto.py @@ -10,8 +10,11 @@ from .common import Extractor, ChapterExtractor, MangaExtractor from .. import text, exception import re -BASE_PATTERN = (r"(?:https?://)?" - r"(?:(?:ba|d|w)to\.to|(?:batotoo|mangatoto)\.com)") +BASE_PATTERN = (r"(?:https?://)?(?:" + r"(?:ba|d|h|m|w)to\.to|" + r"(?:(?:manga|read)toto|batocomic|[xz]bato)\.(?:com|net|org)|" + r"comiko\.(?:net|org)|" + r"bat(?:otoo|o?two)\.com)") class BatotoBase(): diff --git a/test/results/batoto.py b/test/results/batoto.py index d61f7c87..4992bda1 100644 --- a/test/results/batoto.py +++ b/test/results/batoto.py @@ -42,6 +42,19 @@ __tests__ = ( "chapter": 5, }, +{ + "#url" : "https://bato.to/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, + +{ + "#url" : "https://bato.to/chapter/1681030", + "#comment" : "v2 URL", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, + { "#url" : "https://bato.to/title/113742-futsutsuka-na-akujo-de-wa-gozaimasu-ga-suuguu-chouso-torikae-den-official", "#category": ("", "batoto", "manga"), @@ -84,15 +97,16 @@ __tests__ = ( }, { - "#url" : "https://bato.to/title/86408/1681030", - "#category": ("", "batoto", "chapter"), - "#class" : batoto.BatotoChapterExtractor, + "#url" : "https://bato.to/title/86408-i-shall-master-this-family-official", + "#category": ("", "batoto", "manga"), + "#class" : batoto.BatotoMangaExtractor, }, { - "#url" : "https://bato.to/chapter/1681030", - "#category": ("", "batoto", "chapter"), - "#class" : batoto.BatotoChapterExtractor, + "#url" : "https://bato.to/series/86408/i-shall-master-this-family-official", + "#comment" : "v2 URL", + "#category": ("", "batoto", "manga"), + "#class" : batoto.BatotoMangaExtractor, }, { @@ -100,15 +114,18 @@ __tests__ = ( "#category": ("", "batoto", "chapter"), "#class" : batoto.BatotoChapterExtractor, }, - { - "#url" : "https://wto.to/title/86408/1681030", + "#url" : "https://hto.to/title/86408/1681030", "#category": ("", "batoto", "chapter"), "#class" : batoto.BatotoChapterExtractor, }, - { - "#url" : "https://batotoo.com/title/86408/1681030", + "#url" : "https://mto.to/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, +{ + "#url" : "https://wto.to/title/86408/1681030", "#category": ("", "batoto", "chapter"), "#class" : batoto.BatotoChapterExtractor, }, @@ -118,17 +135,106 @@ __tests__ = ( "#category": ("", "batoto", "chapter"), "#class" : batoto.BatotoChapterExtractor, }, - { - "#url" : "https://bato.to/title/86408-i-shall-master-this-family-official", - "#category": ("", "batoto", "manga"), - "#class" : batoto.BatotoMangaExtractor, + "#url" : "https://mangatoto.net/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, +{ + "#url" : "https://mangatoto.org/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, }, { - "#url" : "https://bato.to/series/86408/i-shall-master-this-family-official", - "#category": ("", "batoto", "manga"), - "#class" : batoto.BatotoMangaExtractor, + "#url" : "https://batocomic.com/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, +{ + "#url" : "https://batocomic.net/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, +{ + "#url" : "https://batocomic.org/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, + +{ + "#url" : "https://readtoto.com/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, +{ + "#url" : "https://readtoto.net/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, +{ + "#url" : "https://readtoto.org/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, + +{ + "#url" : "https://xbato.com/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, +{ + "#url" : "https://xbato.net/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, +{ + "#url" : "https://xbato.org/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, + +{ + "#url" : "https://zbato.com/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, +{ + "#url" : "https://zbato.net/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, +{ + "#url" : "https://zbato.org/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, + +{ + "#url" : "https://comiko.net/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, +{ + "#url" : "https://comiko.org/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, + +{ + "#url" : "https://batotoo.com/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, +{ + "#url" : "https://batotwo.com/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, +}, +{ + "#url" : "https://battwo.com/title/86408/1681030", + "#category": ("", "batoto", "chapter"), + "#class" : batoto.BatotoChapterExtractor, }, )