From 84ae72b8d8324e728bea642aaaa9c1f10163843a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 10 Feb 2019 14:19:08 +0100 Subject: [PATCH] [ngomik] fix extraction --- gallery_dl/extractor/ngomik.py | 24 ++++++++++-------------- test/test_results.py | 2 -- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/gallery_dl/extractor/ngomik.py b/gallery_dl/extractor/ngomik.py index 59c9d970..bba743a5 100644 --- a/gallery_dl/extractor/ngomik.py +++ b/gallery_dl/extractor/ngomik.py @@ -17,21 +17,20 @@ class NgomikChapterExtractor(ChapterExtractor): category = "ngomik" root = "http://ngomik.in" pattern = (r"(?:https?://)?(?:www\.)?ngomik\.in" - r"/manga/([^/?&#]+/chapter-[^/?&#]+)") - test = (("http://ngomik.in/manga/chuuko-demo-koi-ga-shitai" - "/chapter-21-5?style=list"), { - "url": "e87ed713f31d576013f179b50b4e10d7c678e53a", - "keyword": "a774caea148fc18a7d889f453dadbe3def9e0c2c", + r"/([^/?&#]+-chapter-[^/?&#]+)") + test = ("https://www.ngomik.in/14-sai-no-koi-chapter-1-6/", { + "url": "8e67fdf751bbc79bc6f4dead7675008ddb8e32a4", + "keyword": "7cc913ed2b9018afbd3336755d28b8252d83044c", }) def __init__(self, match): - url = "{}/manga/{}?style=list".format(self.root, match.group(1)) + url = "{}/{}".format(self.root, match.group(1)) ChapterExtractor.__init__(self, url) def get_metadata(self, page): info = text.extract(page, '', "")[0] - manga, chapter, _ = info.split(" - ") - chapter, sep, minor = chapter.rpartition(" ")[2].partition(".") + manga, _, chapter = info.partition(" Chapter ") + chapter, sep, minor = chapter.partition(" ")[0].partition(".") return { "manga": text.unescape(manga), @@ -43,11 +42,8 @@ class NgomikChapterExtractor(ChapterExtractor): @staticmethod def get_images(page): - readerarea = text.extract( - page, '