Skip to content

Commit

Permalink
[deviantart] fix bug with fetching premium content (#1879)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mikf committed Sep 23, 2021
1 parent ada36c2 commit a23f5d4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gallery_dl/extractor/deviantart.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,17 +349,17 @@ def _fetch_premium(self, deviation):
"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):
Expand Down

0 comments on commit a23f5d4

Please sign in to comment.