mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Add video proxy support
This commit is contained in:
parent
f5fef0ff3a
commit
ce6dace1d7
4 changed files with 20 additions and 6 deletions
|
|
@ -182,16 +182,19 @@ routes:
|
|||
|
||||
get "/video/@sig/@url":
|
||||
cond "http" in @"url"
|
||||
cond "video.twimg" in @"url"
|
||||
let url = decodeUrl(@"url")
|
||||
var url = decodeUrl(@"url")
|
||||
let prefs = cookiePrefs()
|
||||
|
||||
if getHmac(url) != @"sig":
|
||||
resp showError("Failed to verify signature", cfg.title)
|
||||
|
||||
let client = newAsyncHttpClient()
|
||||
let video = await client.getContent(url)
|
||||
client.close()
|
||||
var content = await client.getContent(url)
|
||||
|
||||
resp video, mimetype(url)
|
||||
if ".m3u8" in url:
|
||||
content = proxifyVideo(content, prefs.proxyVideos)
|
||||
|
||||
client.close()
|
||||
resp content, mimetype(url)
|
||||
|
||||
runForever()
|
||||
|
|
|
|||
Loading…
Reference in a new issue