diff --git a/docs/configuration.rst b/docs/configuration.rst index 83972e23..08b58dad 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -6963,6 +6963,16 @@ Description Enable `Data Saver` mode and download lower quality versions of chapters. +extractor.weebdex.manga.lang +---------------------------- +Type + ``string`` +Default + ``"en"`` +Description + |ISO 639-1| code selecting which chapters to download. + + extractor.weibo.gifs -------------------- Type diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index b2302aa9..addbcf05 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -967,7 +967,8 @@ }, "weebdex": { - "data-saver": false + "data-saver": false, + "lang" : "en" }, "weibo": { diff --git a/gallery_dl/extractor/weebdex.py b/gallery_dl/extractor/weebdex.py index 4be7ae24..4e36e7ff 100644 --- a/gallery_dl/extractor/weebdex.py +++ b/gallery_dl/extractor/weebdex.py @@ -85,17 +85,21 @@ class WeebdexChapterExtractor(WeebdexBase, ChapterExtractor): class WeebdexMangaExtractor(WeebdexBase, MangaExtractor): """Extractor for weebdex manga""" chapterclass = WeebdexChapterExtractor - pattern = BASE_PATTERN + r"/title/(\w+)" + reverse = False + pattern = BASE_PATTERN + r"/title/(\w+)(?:/[^/?#]+/?\?([^#]+))?" example = "https://weebdex.org/title/ID/SLUG" def chapters(self, page): - mid = self.groups[0] - url = f"{self.root_api}/manga/{mid}/chapters" - params = { - "limit": 100, - "order": "asc" if self.config("chapter-reverse") else "desc", - } + mid, qs = self.groups + params = text.parse_query(qs) + params.setdefault("limit", 100) + if "tlang" not in params: + params["tlang"] = self.config("lang", "en") + if "order" not in params: + params["order"] = ("desc" if self.config("chapter-reverse") else + "asc") + url = f"{self.root_api}/manga/{mid}/chapters" base = self.root + "/chapter/" manga = _manga_info(self, mid) results = [] diff --git a/test/results/weebdex.py b/test/results/weebdex.py index f8f7e0be..9c96d1de 100644 --- a/test/results/weebdex.py +++ b/test/results/weebdex.py @@ -154,6 +154,7 @@ ___ "#url" : "https://weebdex.org/title/3o0icxno26/ani-datta-mono", "#class" : weebdex.WeebdexMangaExtractor, "#pattern" : weebdex.WeebdexChapterExtractor.pattern, + "#options" : {"lang": None}, "#count" : range(120, 300), "artist" : ["Matsuda Minoru"], @@ -211,4 +212,72 @@ ___ "year" : 2003, }, +{ + "#url" : "https://weebdex.org/title/3o0icxno26/ani-datta-mono", + "#comment" : "'lang' option (#8957)", + "#class" : weebdex.WeebdexMangaExtractor, + "#pattern" : weebdex.WeebdexChapterExtractor.pattern, + "#options" : {"lang": "vi"}, + "#count" : 105, + + "artist" : ["Matsuda Minoru"], + "author" : ["Matsuda Minoru"], + "chapter" : range(1, 105), + "chapter_minor": {"", ".5"}, + "demographic" : "seinen", + "description" : str, + "language" : "vi", + "manga" : "Ani Datta Mono", + "manga_date" : "dt:2025-10-09 19:02:04", + "manga_id" : "3o0icxno26", + "origin" : "ja", + "status" : "ongoing", + "version" : int, + "volume" : int, + "year" : 2021, + "tags" : [ + "genre:Drama", + "genre:Horror", + "genre:Psychological", + "genre:Romance", + "genre:Thriller", + "theme:Ghosts", + "theme:Supernatural", + ], + "relationships": { + "groups" : [{ + "id" : "u7kmeka8v6", + "name": "BBB Translation (Big Beaming Bluewhale)", + }], + }, +}, + +{ + "#url" : "https://weebdex.org/title/3o0icxno26/ani-datta-mono?group=j0fsj3oem3&order=asc", + "#comment" : "query parameters (#8957)", + "#class" : weebdex.WeebdexMangaExtractor, + "#range" : "1-3", + "#results" : ( + "https://weebdex.org/chapter/xv2cm9bj1a", + "https://weebdex.org/chapter/etoaxmxgcq", + "https://weebdex.org/chapter/24ew0mo562", + ), + + "artist" : ["Matsuda Minoru"], + "author" : ["Matsuda Minoru"], + "chapter" : range(1, 3), + "language" : "en", + "manga" : "Ani Datta Mono", + "manga_date" : "dt:2025-10-09 19:02:04", + "manga_id" : "3o0icxno26", + "version" : 1, + "volume" : 1, + "relationships": { + "groups" : [{ + "id" : "j0fsj3oem3", + "name": "Rainbow D Translations", + }], + }, +}, + )