From e9353c63d6494f69670a564f0fa40a18b34b9961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 13 Apr 2023 14:20:43 +0200 Subject: [PATCH] [deviantart] keep using private access tokens for deviations returned from a private API call also fixes a bug from 0a7eee3e where '_pagination()' would never switch from unspecified (None) to private access token --- 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 7a7fffb6..f532a976 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -1569,6 +1569,11 @@ class DeviantartOAuthAPI(): def _pagination(self, endpoint, params, extend=True, public=None, unpack=False, key="results"): warn = True + if public is None: + public = self.public + elif not public: + self.public = False + while True: data = self._call(endpoint, params=params, public=public) if key not in data: @@ -1583,7 +1588,7 @@ class DeviantartOAuthAPI(): if public and len(results) < params["limit"]: if self.refresh_token_key: self.log.debug("Switching to private access token") - public = False + self.public = public = False continue elif data["has_more"] and warn: warn = False