Fix audio url in video m3u8

This commit is contained in:
jackyzy823 2024-01-11 15:26:19 +08:00
parent 508e99d7c4
commit 2f9ae529c0
1 changed files with 2 additions and 0 deletions

View File

@ -82,6 +82,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