Compare commits

...

2 commits

Author SHA1 Message Date
somini 3feaeb7477 Update auth.nim
Avoid expiring the tokens for now.

See:
- https://github.com/zedeus/nitter/issues/983#issuecomment-1923046398
- https://github.com/zedeus/nitter/issues/1155#issuecomment-1917167072

Thanks @cmj
2024-02-26 02:22:47 +00:00
jackyzy823 cdff5e9b1c
Fix for #1147, Proxy for audio URL and upgrade hls.js (#1178)
* Revert "Fix broken video playback by forcing fmp4"

This reverts commit 52db03b73a.

* Fix audio url in video m3u8

* Upgrade hls.js to 1.5.1 and use full version
2024-02-21 23:10:54 +00:00
6 changed files with 10 additions and 10 deletions

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

View file

@ -202,7 +202,7 @@ proc initAccountPool*(cfg: Config; path: string) =
quit 1
let accountsPrePurge = accountPool.len
accountPool.keepItIf(not it.hasExpired)
#accountPool.keepItIf(not it.hasExpired)
log "Successfully added ", accountPool.len, " valid accounts."
if accountsPrePurge > accountPool.len:

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

View file

@ -31,9 +31,7 @@ proc getHmac*(data: string): string =
proc getVidUrl*(link: string): string =
if link.len == 0: return
let
link = link.replace("cmaf", "fmp4")
sig = getHmac(link)
let sig = getHmac(link)
if base64Media:
&"/video/enc/{sig}/{encode(link, safe=true)}"
else:

View file

@ -73,7 +73,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: