From a23f5d45d79cd87c27949cc37bee8d404694dc98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 23 Sep 2021 16:49:59 +0200 Subject: [PATCH] [deviantart] fix bug with fetching premium content (#1879) When a user has both 'watchers' and 'paid' folders and one of them is inaccessible, the other one could get handled as inaccessible as well. --- gallery_dl/extractor/deviantart.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index eac86b4d..7dac770b 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -349,17 +349,17 @@ class DeviantartExtractor(Extractor): "Error when trying to watch %s. " "Try again with a new refresh-token", username) - if not has_access: + if has_access: + self.log.info("Fetching premium folder data") + else: self.log.warning("Unable to access premium content (type: %s)", folder["type"]) - self._fetch_premium = lambda _: None - return None - self.log.info("Fetching premium folder data") cache = self._premium_cache for dev in self.api.gallery( username, folder["gallery_id"], public=False): - cache[dev["deviationid"]] = dev + cache[dev["deviationid"]] = dev if has_access else None + return cache[deviation["deviationid"]] def _unwatch_premium(self):