From 423f68f585b0fe334299bd8da9a4e5239d60f7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 11 Aug 2019 16:06:15 +0200 Subject: [PATCH] [deviantart] fix scraps extraction (closes #376) --- gallery_dl/extractor/deviantart.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index a04f7ba7..aa05fb19 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -590,19 +590,27 @@ class DeviantartScrapsExtractor(DeviantartExtractor): csrf, pos = text.extract(page, '"csrf":"', '"') iid , pos = text.extract(page, '"requestid":"', '"', pos) - url = "https://www.deviantart.com/dapi/v1/gallery/0" + params = { + "iid": iid + "-jz6wpfib-1.1", + "mp": 0, + } + headers = { + "Referer": url, + } data = { "username": self.user, "offset": self.offset, "limit": "24", "catpath": "scraps", "_csrf": csrf, - "dapiIid": iid + "-jsok7403-1.1" + "dapiIid": params["iid"] } + url = "https://www.deviantart.com/dapi/v1/gallery/0" while True: content = self.request( - url, method="POST", data=data).json()["content"] + url, method="POST", params=params, + headers=headers, data=data).json()["content"] for item in content["results"]: if item["html"].startswith('