From 263333783310cbfa59e8d52d739643520a2b8b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 19 Jun 2017 09:55:02 +0200 Subject: [PATCH] [kissmanga] update regex (fixes #20) --- gallery_dl/extractor/kissmanga.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gallery_dl/extractor/kissmanga.py b/gallery_dl/extractor/kissmanga.py index 9669138d7d..69d0bed859 100644 --- a/gallery_dl/extractor/kissmanga.py +++ b/gallery_dl/extractor/kissmanga.py @@ -61,7 +61,11 @@ class KissmangaChapterExtractor(KissmangaExtractor): ("http://kissmanga.com/Manga/Urban-Tales/a?id=256717", { "url": "de074848f6c1245204bb9214c12bcc3ecfd65019", "keyword": "013aad80e578c6ccd2e1fe47cdc27c12a64f6db2", - }) + }), + ("http://kissmanga.com/Manga/Monster/Monster-79?id=7608", { + "url": "6abec8178f35fe7846586280ca9e38eacc32452c", + "keyword": "ca7a07ecfd9525c0f825dc747f520306611d6af9", + }), ] def items(self): @@ -78,13 +82,14 @@ def get_job_metadata(self, page): """Collect metadata for extractor-job""" manga, pos = text.extract(page, "Read manga\n", "\n") cinfo, pos = text.extract(page, "", "\n", pos) - match = re.match((r"(?:Vol.0*(\d+) )?(?:Ch.)?0*(\d+)" - r"(?:\.0*(\d+))?(?:: (.+))?"), cinfo) - chminor = match.group(3) + match = re.match(( + r"(?:[Vv]ol.0*(\d+) )?(?:[Cc]h.)?0*(\d+)(?:\.0*(\d+))?(?:: (.+))?|" + r"[\w ]+?(?: -)? 0*(\d+)(?: (.+))?"), cinfo) + chminor = match.group(3) or match.group(6) return { "manga": manga, "volume": match.group(1) or "", - "chapter": match.group(2), + "chapter": match.group(2) or match.group(5), "chapter-minor": "."+chminor if chminor else "", "title": match.group(4) or "", "lang": "en",