[twitter] handle 429 responses without x-rate-limit-reset header
This commit is contained in:
@@ -503,8 +503,9 @@ class TwitterAPI():
|
|||||||
if response.status_code < 400:
|
if response.status_code < 400:
|
||||||
return response.json()
|
return response.json()
|
||||||
if response.status_code == 429:
|
if response.status_code == 429:
|
||||||
self.extractor.wait(until=response.headers["x-rate-limit-reset"])
|
until = response.headers.get("x-rate-limit-reset")
|
||||||
return self._call(endpoint, params)
|
self.extractor.wait(until=until, seconds=(None if until else 60))
|
||||||
|
return self._call(endpoint, params, method)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
msg = ", ".join(
|
msg = ", ".join(
|
||||||
|
|||||||
Reference in New Issue
Block a user