[nhentai] fix JSON extraction

pull/73/head
Mike Fährmann 7 years ago
parent 444008a14a
commit 91c2aed077
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -4,6 +4,8 @@
- Added support for:
- `slideshare` - https://www.slideshare.net/ ([#54](https://github.com/mikf/gallery-dl/issues/54))
- Added pool- and post-extractors for `sankaku`
- Improved `luscious` to support `members.luscious.net` URLs ([#55](https://github.com/mikf/gallery-dl/issues/55))
- Fixed extraction issues for `nhentai` and `khinsider`
## 1.1.0 - 2017-12-08
- Added the ``-r/--limit-rate`` command-line option to set a maximum download rate

@ -48,9 +48,12 @@ class NhentaiGalleryExtractor(Extractor):
"""Extract and return gallery-info"""
page = self.request("https://nhentai.net/g/" + self.gid + "/1/").text
media_url, pos = text.extract(
page, ".reader({\n\t\t\tmedia_url: '", "'")
page, "media_url: '", "'")
json_data, pos = text.extract(
page, "gallery: ", ",\n", pos)
if json_data.startswith("b'"):
json_data = json_data[2:-1].replace(r"\\u", r"\u")
json_dict = json.loads(json_data)
json_dict["media_url"] = media_url
return json_dict

Loading…
Cancel
Save