fix video playback
Some checks failed
Build and publish the docker image / build (push) Failing after 14s

Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
ngn 2025-01-21 05:29:57 +03:00
parent 96dad1e3a1
commit 48b1d9e565
Signed by: ngn
GPG Key ID: A3654DF5AD9F641D
4 changed files with 6 additions and 7 deletions

File diff suppressed because one or more lines are too long

2
public/js/hls.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,7 @@ proc shortLink*(text: string; length=28): string =
result = text.replace(wwwRegex, "")
if result.len > length:
result = result[0 ..< length] & ""
proc stripHtml*(text: string; shorten=false): string =
var html = parseHtml(text)
for el in html.findAll("a"):
@ -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

View File

@ -71,7 +71,7 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc="";
link(rel="alternate", type="application/rss+xml", href=rss, title="RSS feed")
if prefs.hlsPlayback:
script(src="/js/hls.light.min.js", `defer`="")
script(src="/js/hls.min.js", `defer`="")
script(src="/js/hlsPlayback.js", `defer`="")
if prefs.infiniteScroll: