[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.
This commit is contained in:
@@ -349,17 +349,17 @@ class DeviantartExtractor(Extractor):
|
|||||||
"Error when trying to watch %s. "
|
"Error when trying to watch %s. "
|
||||||
"Try again with a new refresh-token", username)
|
"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)",
|
self.log.warning("Unable to access premium content (type: %s)",
|
||||||
folder["type"])
|
folder["type"])
|
||||||
self._fetch_premium = lambda _: None
|
|
||||||
return None
|
|
||||||
|
|
||||||
self.log.info("Fetching premium folder data")
|
|
||||||
cache = self._premium_cache
|
cache = self._premium_cache
|
||||||
for dev in self.api.gallery(
|
for dev in self.api.gallery(
|
||||||
username, folder["gallery_id"], public=False):
|
username, folder["gallery_id"], public=False):
|
||||||
cache[dev["deviationid"]] = dev
|
cache[dev["deviationid"]] = dev if has_access else None
|
||||||
|
|
||||||
return cache[deviation["deviationid"]]
|
return cache[deviation["deviationid"]]
|
||||||
|
|
||||||
def _unwatch_premium(self):
|
def _unwatch_premium(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user