Skip to content

Commit

Permalink
[kissmanga] update regex (fixes #20)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jun 19, 2017
1 parent fac6c02 commit 2633337
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions gallery_dl/extractor/kissmanga.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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",
Expand Down

0 comments on commit 2633337

Please sign in to comment.