[nhentai] fix JSON extraction
This commit is contained in:
parent
444008a14a
commit
91c2aed077
@ -4,6 +4,8 @@
|
|||||||
- Added support for:
|
- Added support for:
|
||||||
- `slideshare` - https://www.slideshare.net/ ([#54](https://github.com/mikf/gallery-dl/issues/54))
|
- `slideshare` - https://www.slideshare.net/ ([#54](https://github.com/mikf/gallery-dl/issues/54))
|
||||||
- Added pool- and post-extractors for `sankaku`
|
- 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
|
## 1.1.0 - 2017-12-08
|
||||||
- Added the ``-r/--limit-rate`` command-line option to set a maximum download rate
|
- 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"""
|
"""Extract and return gallery-info"""
|
||||||
page = self.request("https://nhentai.net/g/" + self.gid + "/1/").text
|
page = self.request("https://nhentai.net/g/" + self.gid + "/1/").text
|
||||||
media_url, pos = text.extract(
|
media_url, pos = text.extract(
|
||||||
page, ".reader({\n\t\t\tmedia_url: '", "'")
|
page, "media_url: '", "'")
|
||||||
json_data, pos = text.extract(
|
json_data, pos = text.extract(
|
||||||
page, "gallery: ", ",\n", pos)
|
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 = json.loads(json_data)
|
||||||
json_dict["media_url"] = media_url
|
json_dict["media_url"] = media_url
|
||||||
return json_dict
|
return json_dict
|
||||||
|
Loading…
x
Reference in New Issue
Block a user