From 91c2aed07708114849f2e94a2f000ed029b304bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 17 Dec 2017 16:25:06 +0100 Subject: [PATCH] [nhentai] fix JSON extraction --- CHANGELOG.md | 2 ++ gallery_dl/extractor/nhentai.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a652f561..b097cf53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/gallery_dl/extractor/nhentai.py b/gallery_dl/extractor/nhentai.py index 4a0b9214..ec0a65ac 100644 --- a/gallery_dl/extractor/nhentai.py +++ b/gallery_dl/extractor/nhentai.py @@ -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