Restrict image/gif media host instead of hashing

This commit is contained in:
Zed
2019-09-13 12:27:04 +02:00
parent ec43987363
commit 9c91688497
7 changed files with 65 additions and 25 deletions

View File

@@ -77,7 +77,7 @@ proc stripTwitterUrls*(text: string): string =
proc proxifyVideo*(manifest: string; proxy: bool): string =
proc cb(m: RegexMatch; s: string): string =
result = "https://video.twimg.com" & s[m.group(0)[0]]
if proxy: result = result.getSigUrl("video")
if proxy: result = getVidUrl(result)
result = manifest.replace(re"(.+(.ts|.m3u8|.vmap))", cb)
proc getUserpic*(userpic: string; style=""): string =