1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 12:12:34 +01:00

[kissmanga] fix internal regex

This commit is contained in:
Mike Fährmann 2015-11-07 13:28:07 +01:00
parent 079330785a
commit 5abe32a32c
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 8 additions and 4 deletions

View File

@ -27,6 +27,7 @@ modules = [
"imgchili",
"imgth",
"imgur",
"kissmanga",
"konachan",
"mangareader",
"nhentai",

View File

@ -16,8 +16,8 @@ import re
info = {
"category": "kissmanga",
"extractor": "KissmangaExtractor",
"directory": ["{category}", "{manga}", "c{chapter:>03} - {title}"],
"filename": "{manga}_c{chapter:>03}_{page:>03}.{extension}",
"directory": ["{category}", "{manga}", "c{chapter:>03}{chapter-minor} - {title}"],
"filename": "{manga}_c{chapter:>03}{chapter-minor}_{page:>03}.{extension}",
"pattern": [
r"(?:https?://)?(?:www\.)?kissmanga\.com/Manga/.+/.+\?id=\d+",
],
@ -50,13 +50,16 @@ class KissmangaExtractor(Extractor):
"""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+)(?:: (.+))", cinfo)
match = re.match(
r"(?:Vol.0*(\d+) )?(?:Ch.)?0*(\d+)(?:\.0*(\d+))?(?:: (.+))?", cinfo)
chminor = match.group(3)
return {
"category": info["category"],
"manga": manga,
"volume": match.group(1) or "",
"chapter": match.group(2),
"title": match.group(3) or "",
"chapter-minor": "."+chminor if chminor else "",
"title": match.group(4) or "",
"lang": "en",
"language": "English",
}