fix video playback
Some checks failed
Build and publish the docker image / build (push) Failing after 14s
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:
parent
96dad1e3a1
commit
48b1d9e565
5
public/js/hls.light.min.js
vendored
5
public/js/hls.light.min.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/hls.min.js
vendored
Normal file
2
public/js/hls.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user