Prevent 403 errors from outdated videos

This commit is contained in:
Zed 2019-12-22 01:45:07 +01:00
commit be15f1b001
3 changed files with 13 additions and 17 deletions

View file

@ -47,9 +47,8 @@ proc fetchJson*(url: Uri; headers: HttpHeaders): Future[JsonNode] {.async.} =
headers["accept"] = jsonAccept
newClient()
var resp = ""
try:
resp = await client.getContent($url)
let resp = await client.getContent($url)
result = parseJson(resp)
except:
return nil