mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Prevent 403 errors from outdated videos
This commit is contained in:
parent
7ef3a4faba
commit
be15f1b001
3 changed files with 13 additions and 17 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import strutils, sequtils
|
||||
import strutils, sequtils, asyncdispatch, httpclient
|
||||
import ../utils, ../prefs
|
||||
export utils, prefs
|
||||
|
||||
|
|
@ -13,3 +13,9 @@ template refPath*(): untyped {.dirty.} =
|
|||
|
||||
proc getNames*(name: string): seq[string] =
|
||||
name.strip(chars={'/'}).split(",").filterIt(it.len > 0)
|
||||
|
||||
proc safeFetch*(url: string): Future[string] {.async.} =
|
||||
let client = newAsyncHttpClient()
|
||||
try: result = await client.getContent(url)
|
||||
except: discard
|
||||
client.close()
|
||||
|
|
|
|||
Loading…
Reference in a new issue