[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
This commit is contained in:
@@ -1569,6 +1569,11 @@ class DeviantartOAuthAPI():
|
|||||||
def _pagination(self, endpoint, params,
|
def _pagination(self, endpoint, params,
|
||||||
extend=True, public=None, unpack=False, key="results"):
|
extend=True, public=None, unpack=False, key="results"):
|
||||||
warn = True
|
warn = True
|
||||||
|
if public is None:
|
||||||
|
public = self.public
|
||||||
|
elif not public:
|
||||||
|
self.public = False
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
data = self._call(endpoint, params=params, public=public)
|
data = self._call(endpoint, params=params, public=public)
|
||||||
if key not in data:
|
if key not in data:
|
||||||
@@ -1583,7 +1588,7 @@ class DeviantartOAuthAPI():
|
|||||||
if public and len(results) < params["limit"]:
|
if public and len(results) < params["limit"]:
|
||||||
if self.refresh_token_key:
|
if self.refresh_token_key:
|
||||||
self.log.debug("Switching to private access token")
|
self.log.debug("Switching to private access token")
|
||||||
public = False
|
self.public = public = False
|
||||||
continue
|
continue
|
||||||
elif data["has_more"] and warn:
|
elif data["has_more"] and warn:
|
||||||
warn = False
|
warn = False
|
||||||
|
|||||||
Reference in New Issue
Block a user