From 76ae9957c2e6eb5eab12d2358851843d39285db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 20 Jun 2019 19:18:37 +0200 Subject: [PATCH] [deviantart] force legacy version for single deviations Let's see how long this works ... DeviantArt is rolling out a new version of their website, including a new internal and potentially usable API (rewrite incoming, yay). The issue with the new layout is that it doesn't include the "old" UUIDs for single deviations, i.e. mapping a numeric deviation ID to its UUID counterpart is impossible with the new layout. --- gallery_dl/extractor/deviantart.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index 57e3bc05..94dd7a70 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -408,7 +408,12 @@ class DeviantartDeviationExtractor(DeviantartExtractor): def deviations(self): url = "{}/{}/{}".format(self.root, self.user, self.path) - response = self.request(url, expect=range(400, 500)) + cookies = {"userinfo": ( + '__167217c8e6aac1a3331f;{"username":"","uniqueid":"ab2e8b184471bf0' + 'e3f8ed3ee7a3220aa","vd":"Bc7vEx,BdC7Fy,A,J,A,,B,A,B,BdC7Fy,BdC7XU' + ',J,J,A,BdC7XU,13,A,B,A,,A,A,B,A,A,,A","attr":56}' + )} + response = self.request(url, cookies=cookies, expect=range(400, 500)) deviation_id = text.extract(response.text, '//deviation/', '"')[0] if response.status_code >= 400 or not deviation_id: raise exception.NotFoundError("image")