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