mirror of
https://github.com/zedeus/nitter
synced 2026-09-06 07:09:31 +00:00
raise a RateLimitError when Twitter returns HTTP status 429
This commit is contained in:
parent
95893eedaa
commit
5828a6eccc
1 changed files with 3 additions and 0 deletions
|
|
@ -72,6 +72,9 @@ template fetchImpl(result, fetchBody) {.dirty.} =
|
||||||
if resp.status == "401 Unauthorized" and result.len == 0:
|
if resp.status == "401 Unauthorized" and result.len == 0:
|
||||||
getContent()
|
getContent()
|
||||||
|
|
||||||
|
if resp.status == $Http429:
|
||||||
|
raise rateLimitError()
|
||||||
|
|
||||||
if resp.status == $Http503:
|
if resp.status == $Http503:
|
||||||
badClient = true
|
badClient = true
|
||||||
raise newException(InternalError, result)
|
raise newException(InternalError, result)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue