diff --git a/gallery_dl/extractor/mangahere.py b/gallery_dl/extractor/mangahere.py index c129efc1..8e3d4077 100644 --- a/gallery_dl/extractor/mangahere.py +++ b/gallery_dl/extractor/mangahere.py @@ -16,16 +16,40 @@ import re class MangahereMangaExtractor(MangaExtractor): """Extractor for manga from mangahere.co""" category = "mangahere" - pattern = [r"(?:https?://)?((?:www\.)?mangahere\.co/manga/[^/]+/?)$"] - test = [("http://www.mangahere.co/manga/aria/", { - "url": "77d96842292a6a341e8937816ed45cc09b538cf0", - })] + pattern = [r"(?:https?://)?((?:www\.)?mangahere\.co/manga/" + r"[^/]+)/?(?:#.*)?$"] + test = [ + ("http://www.mangahere.co/manga/aria/", { + "url": "77d96842292a6a341e8937816ed45cc09b538cf0", + "keyword": "951eef36a3775525a31ca78c9d9cea546f4cf2f5", + }), + ("http://www.mangahere.co/manga/hiyokoi#50", { + "url": "f33cff8616dbc382a76034d9604e7671506ac02a", + "keyword": "9542283639bd082fabf3a14b6695697d3ef15111", + }) + ] def chapters(self, page): - return list(text.extract_iter( - page, '') - )) + results = [] + pos = page.index('
') + manga, pos = text.extract(page, '

Read ', ' Online

', pos) + manga = text.unescape(manga) + + while True: + url, pos = text.extract( + page, '
', '<', pos) + title, pos = text.extract(page, '/span>', '<', pos) + date, pos = text.extract(page, 'class="right">', '', pos) + results.append((url, { + "manga": manga, "title": title, "date": date, + "chapter": int(chapter), "chapter_minor": dot + minor, + "volume": int(volume.rpartition(" ")[2]) if volume else 0, + "lang": "en", "language": "English", + })) class MangahereChapterExtractor(AsynchronousExtractor):