[redhawkscans] fix json extraction

pull/13/head
Mike Fährmann 9 years ago
parent b3f656ffd5
commit a9e68c2745

@ -51,7 +51,7 @@ class RedHawkScansExtractor(SequentialExtractor):
_ , pos = self.extract(page, '<h1 class="tbtitle dnone">', '') _ , pos = self.extract(page, '<h1 class="tbtitle dnone">', '')
manga , pos = self.extract(page, 'title="', '"', pos) manga , pos = self.extract(page, 'title="', '"', pos)
chapter , pos = self.extract(page, 'title="', '"', pos) chapter , pos = self.extract(page, 'title="', '"', pos)
json_data, pos = self.extract(page, 'var pages = ', '\n', pos) json_data, pos = self.extract(page, 'var pages = ', ';\r\n', pos)
match = re.match(r"Chapter (\d+)(?:: (.*))?", chapter) match = re.match(r"Chapter (\d+)(?:: (.*))?", chapter)
return { return {
"category": info["category"], "category": info["category"],
@ -59,4 +59,4 @@ class RedHawkScansExtractor(SequentialExtractor):
"chapter": match.group(1), "chapter": match.group(1),
"language": "English", "language": "English",
"title": unescape(match.group(2) or ""), "title": unescape(match.group(2) or ""),
}, json.loads(json_data[:-2]) }, json.loads(json_data)

Loading…
Cancel
Save