diff --git a/gallery_dl/extractor/mangataro.py b/gallery_dl/extractor/mangataro.py index 7d9c1260..5bccc759 100644 --- a/gallery_dl/extractor/mangataro.py +++ b/gallery_dl/extractor/mangataro.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Mike Fährmann +# Copyright 2025-2026 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -11,6 +11,8 @@ from .common import ChapterExtractor, MangaExtractor from .. import text from ..cache import memcache +import hashlib +import time BASE_PATTERN = r"(?:https?://)?mangataro\.org" @@ -59,27 +61,56 @@ class MangataroChapterExtractor(MangataroBase, ChapterExtractor): class MangataroMangaExtractor(MangataroBase, MangaExtractor): """Extractor for mangataro manga""" chapterclass = MangataroChapterExtractor - pattern = BASE_PATTERN + r"(/manga/([^/?#]+))" + pattern = BASE_PATTERN + r"/manga/([^/?#]+)" example = "https://mangataro.org/manga/MANGA" - def chapters(self, page): - slug = self.groups[1] - manga = _manga_info(self, slug) + def chapters(self, _): + manga = _manga_info(self, self.groups[0]) + + url = self.root + "/auth/manga-chapters" + params = { + "manga_id": manga["manga_id"], + "offset" : 0, + "limit" : 500, # values higher than 500 have no effect + "order" : "DESC", + } + headers = { + "Referer" : manga["manga_url"], + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-origin", + } results = [] - for url in text.extract_iter(text.extr( - page, '
04}{m:>02}{d:>02}{H:>02}" + params["_t"] = hashlib.md5(secret.encode()).hexdigest()[:16] + params["_ts"] = ts + @memcache(keyarg=1) def _manga_info(self, slug): @@ -89,6 +120,7 @@ def _manga_info(self, slug): return { "manga" : manga["name"].rpartition(" | ")[0].rpartition(" ")[0], + "manga_id" : text.extr(page, 'data-manga-id="', '"'), "manga_url" : manga["url"], "cover" : manga["image"], "author" : manga["author"]["name"].split(", "), diff --git a/test/results/mangataro.py b/test/results/mangataro.py index a27dc932..6c5f9380 100644 --- a/test/results/mangataro.py +++ b/test/results/mangataro.py @@ -106,11 +106,11 @@ __tests__ = ( "#url" : "https://mangataro.org/manga/lookism", "#class" : mangataro.MangataroMangaExtractor, "#pattern" : mangataro.MangataroChapterExtractor.pattern, - "#count" : 573, + "#count" : range(580, 800), - "chapter" : range(1, 573), + "chapter" : range(1, 800), "chapter_id" : int, - "chapter_minor": "", + "chapter_minor": {"", ".1", ".5"}, "cover" : "https://mangataro.org/content/media/208866l.webp", "description" : "

Park Hyung Suk has spent all 17 years of his life at the bottom of the food chain. Short, overweight, and unattractive, he is used to being bullied by his classmates and constantly discriminated against for his looks. In an attempt to escape his biggest bully, Lee Tae Sung, he decides to transfer to Seoul’s Jae Won High School, a vocational preparatory school notorious for its liberal education system and carefree students. Days before his transfer, Hyung Suk wakes to find that he is no longer in his usual chubby body, but is instead in a perfect body! Tall, handsome, and beautifully toned, Hyung Suk has become the ideal version of himself. The only problem is that his original body still lays beside him—and when one body falls asleep, he awakens in the other. Now possessing two extremely different bodies, Hyung Suk must learn to navigate his new and much more popular life at J High whilst also solving the mystery of where his second, almost superhuman, body came from. [Written by MAL Rewrite]

Background

Lookism is originally a webtoon which first volume was officially published in paperbook format by &Book (대원앤북) on May 25, 2017. The series has been serialized in English by LINE Webtoon since June 4, 2017.

", "genre" : "Manhwa",