diff --git a/gallery_dl/extractor/mangafox.py b/gallery_dl/extractor/mangafox.py index 4808105c..0818fd90 100644 --- a/gallery_dl/extractor/mangafox.py +++ b/gallery_dl/extractor/mangafox.py @@ -10,7 +10,6 @@ from .common import ChapterExtractor, MangaExtractor from .. import text -import re BASE_PATTERN = r"(?:https?://)?(?:www\.|m\.)?(?:fanfox\.net|mangafox\.me)" @@ -44,14 +43,14 @@ class MangafoxChapterExtractor(ChapterExtractor): cid , pos = text.extract(page, "var chapter_id =", ";", pos) return { - "manga": text.unescape(manga), - "volume": text.parse_int(self.volume), - "chapter": text.parse_int(self.chapter), - "chapter_minor": self.minor or "", + "manga" : text.unescape(manga), + "volume" : text.parse_int(self.volume), + "chapter" : text.parse_int(self.chapter), + "chapter_minor" : self.minor or "", "chapter_string": self.cstr, - "count": text.parse_int(count), - "sid": text.parse_int(sid), - "cid": text.parse_int(cid), + "count" : text.parse_int(count), + "sid" : text.parse_int(sid), + "cid" : text.parse_int(cid), } def images(self, page): @@ -76,6 +75,25 @@ class MangafoxMangaExtractor(MangaExtractor): ("https://fanfox.net/manga/kanojo_mo_kanojo", { "pattern": MangafoxChapterExtractor.pattern, "count": ">=60", + "keyword": { + "author": "HIROYUKI", + "chapter": int, + "chapter_minor": r"re:^(\.\d+)?$", + "chapter_string": r"re:(v\d+/)?c\d+", + "date": "type:datetime", + "description": "High school boy Naoya gets a confession from M" + "omi, a cute and friendly girl. However, Naoya " + "already has a girlfriend, Seki... but Momi is " + "too good a catch to let go. Momi and Nagoya's " + "goal becomes clear: convince Seki to accept be" + "ing an item with the two of them. Will she bud" + "ge?", + "lang": "en", + "language": "English", + "manga": "Kanojo mo Kanojo", + "tags": ["Comedy", "Romance", "School Life", "Shounen"], + "volume": int, + }, }), ("https://mangafox.me/manga/shangri_la_frontier", { "pattern": MangafoxChapterExtractor.pattern, @@ -85,34 +103,41 @@ class MangafoxMangaExtractor(MangaExtractor): ) def chapters(self, page): - match_info = re.compile(r"Ch (\d+)(\S*)(?: (.*))?").match - manga, pos = text.extract(page, '
', '
') - author, pos = text.extract(page, 'Author(s):', '
', pos) + results = [] + chapter_match = MangafoxChapterExtractor.pattern.match + + extr = text.extract_from(page) + manga = extr('', '
') + author = extr('Author(s):', '
') + extr('