[nhentai] fix json detection

This commit is contained in:
Mike Fährmann 2016-07-12 12:07:36 +02:00
parent 000df8d1fa
commit 93c8f6e777
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -45,7 +45,7 @@ class NhentaiExtractor(Extractor):
def get_gallery_info(self):
"""Extract and return gallery-info"""
page = self.request("http://nhentai.net/g/" + self.gid + "/1/").text
media_url, pos = text.extract(page, "nhentai.reader({\n\t\t\tmedia_url: '", "'")
media_url, pos = text.extract(page, ".reader({\n\t\t\tmedia_url: '", "'")
json_data, pos = text.extract(page, "gallery: ", ",\n", pos)
json_dict = json.loads(json_data)
json_dict["media_url"] = media_url