fix: hls playback

This commit is contained in:
taskylizard 2024-06-21 21:41:28 +00:00
parent 5895d2e276
commit 049347a857
No known key found for this signature in database
GPG key ID: 1820131ED1A24120

View file

@ -91,6 +91,8 @@ proc proxifyVideo*(manifest: string; proxy: bool): string =
for line in manifest.splitLines:
let url =
if line.startsWith("#EXT-X-MAP:URI"): line[16 .. ^2]
elif line.startsWith("#EXT-X-MEDIA") and "URI=" in line:
line[line.find("URI=") + 5 .. -1 + line.find("\"", start= 5 + line.find("URI="))]
else: line
if url.startsWith('/'):
let path = "https://video.twimg.com" & url