mirror of
https://github.com/zedeus/nitter.git
synced 2024-06-01 19:33:49 +00:00
Merge branch 'zedeus:master' into master
This commit is contained in:
commit
c9c82d2782
|
@ -20,7 +20,7 @@ requires "packedjson#9e6fbb6"
|
|||
requires "supersnappy#6c94198"
|
||||
requires "redpool#8b7c1db"
|
||||
requires "https://github.com/zedeus/redis#d0a0e6f"
|
||||
requires "zippy#61922b9"
|
||||
requires "zippy#88a5a5a"
|
||||
requires "flatty#9f885d7"
|
||||
requires "jsony#d0e69bd"
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ proc genParams*(pars: openArray[(string, string)] = @[]; cursor="";
|
|||
result &= ("count", count)
|
||||
if cursor.len > 0:
|
||||
# The raw cursor often has plus signs, which sometimes get turned into spaces,
|
||||
# so we need to them back into a plus
|
||||
# so we need to turn them back into a plus
|
||||
if " " in cursor:
|
||||
result &= ("cursor", cursor.replace(" ", "+"))
|
||||
else:
|
||||
|
@ -69,9 +69,7 @@ template fetchImpl(result, fetchBody) {.dirty.} =
|
|||
|
||||
# Twitter randomly returns 401 errors with an empty body quite often.
|
||||
# Retrying the request usually works.
|
||||
var attempt = 0
|
||||
while resp.status == "401 Unauthorized" and result.len == 0 and attempt < 3:
|
||||
inc attempt
|
||||
if resp.status == "401 Unauthorized" and result.len == 0:
|
||||
getContent()
|
||||
|
||||
if resp.status == $Http503:
|
||||
|
|
Loading…
Reference in a new issue