fix rate limit handling for OAuth APIs (#368)

This commit is contained in:
Mike Fährmann
2019-08-03 13:43:00 +02:00
parent f687052daf
commit f4bc75e854
4 changed files with 5 additions and 4 deletions

View File

@@ -234,7 +234,7 @@ class RedditAPI():
url = "https://oauth.reddit.com" + endpoint
params["raw_json"] = 1
self.authenticate()
response = self.extractor.request(url, params=params, fatal=False)
response = self.extractor.request(url, params=params, fatal=None)
remaining = response.headers.get("x-ratelimit-remaining")
if remaining and float(remaining) < 2:
wait = int(response.headers["x-ratelimit-reset"])