streamd: optional keys, per-stream proxy, auto deps; agent module.yaml sync; RTE AutoPlay; Telegram release announces
- streamd: MPD-only start, proxy field, ffmpeg/NRE/mp4decrypt auto-install - GET/PUT /api/modules for module.yaml sync; agent sync_modules - RTE Live-tab AutoPlay fixes; modules zip named bbc/rte/tg4.zip - Telegram notify scripts wired into Forgejo release workflows
This commit is contained in:
parent
f9c28be3f1
commit
ac8701b5a6
36 changed files with 1460 additions and 143 deletions
71
apps/streamd/internal/deps/fetch_nre.go
Normal file
71
apps/streamd/internal/deps/fetch_nre.go
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
package deps
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
const nreTag = "v0.6.0-beta"
|
||||
const nreBase = "https://github.com/nilaoda/N_m3u8DL-RE/releases/download/" + nreTag + "/"
|
||||
|
||||
func fetchNRE(binDir string, logf func(string, ...any)) (string, error) {
|
||||
url, archiveName, binName, err := nreURL()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
archivePath := filepath.Join(binDir, archiveName)
|
||||
if err := downloadTo(url, archivePath, logf); err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer func() { _ = os.Remove(archivePath) }()
|
||||
|
||||
dest := filepath.Join(binDir, binName)
|
||||
if err := extractNamed(archivePath, binDir, binName, dest); err != nil {
|
||||
// Some archives nest the binary or use a slightly different name.
|
||||
if err2 := extractNamed(archivePath, binDir, "N_m3u8DL-RE", dest); err2 != nil {
|
||||
if runtime.GOOS == "windows" {
|
||||
if err3 := extractNamed(archivePath, binDir, "N_m3u8DL-RE.exe", dest); err3 != nil {
|
||||
return "", err
|
||||
}
|
||||
} else {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
}
|
||||
chmodX(dest)
|
||||
return dest, nil
|
||||
}
|
||||
|
||||
func nreURL() (url, archiveName, binName string, err error) {
|
||||
binName = "N_m3u8DL-RE"
|
||||
if runtime.GOOS == "windows" {
|
||||
binName = "N_m3u8DL-RE.exe"
|
||||
}
|
||||
switch runtime.GOOS + "/" + runtime.GOARCH {
|
||||
case "windows/amd64":
|
||||
name := "N_m3u8DL-RE_v0.6.0-beta_win-x64_20260629.zip"
|
||||
return nreBase + name, name, binName, nil
|
||||
case "windows/arm64":
|
||||
name := "N_m3u8DL-RE_v0.6.0-beta_win-arm64_20260629.zip"
|
||||
return nreBase + name, name, binName, nil
|
||||
case "windows/386":
|
||||
name := "N_m3u8DL-RE_v0.6.0-beta_win-NT6.0-x86_20260629.zip"
|
||||
return nreBase + name, name, binName, nil
|
||||
case "linux/amd64":
|
||||
name := "N_m3u8DL-RE_v0.6.0-beta_linux-x64_20260629.tar.gz"
|
||||
return nreBase + name, name, binName, nil
|
||||
case "linux/arm64":
|
||||
name := "N_m3u8DL-RE_v0.6.0-beta_linux-arm64_20260629.tar.gz"
|
||||
return nreBase + name, name, binName, nil
|
||||
case "darwin/amd64":
|
||||
name := "N_m3u8DL-RE_v0.6.0-beta_osx-x64_20260629.tar.gz"
|
||||
return nreBase + name, name, binName, nil
|
||||
case "darwin/arm64":
|
||||
name := "N_m3u8DL-RE_v0.6.0-beta_osx-arm64_20260629.tar.gz"
|
||||
return nreBase + name, name, binName, nil
|
||||
default:
|
||||
return "", "", "", fmt.Errorf("unsupported platform %s/%s for N_m3u8DL-RE auto-download", runtime.GOOS, runtime.GOARCH)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue