Better detection for Cloudflare related 429s.
At some point Cloudflare started returning some JSON. I don't know how this JSON looks like. See #2544
This commit is contained in:
parent
3b8678da81
commit
25a04ed135
@ -179,7 +179,7 @@ class HTTPClient:
|
|||||||
|
|
||||||
# we are being rate limited
|
# we are being rate limited
|
||||||
if r.status == 429:
|
if r.status == 429:
|
||||||
if not isinstance(data, dict):
|
if not r.headers.get('Via'):
|
||||||
# Banned by Cloudflare more than likely.
|
# Banned by Cloudflare more than likely.
|
||||||
raise HTTPException(r, data)
|
raise HTTPException(r, data)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user