v0.1.1: external modules, publish YAML, proxy reset, binary-first README
- Host discovers/builds modules under modules/ (bbc, rte, tg4) - module-publish.yaml tracked; local module.yaml gitignored - drm --modules-dir / DRM_MODULES_DIR - drm proxy reset; Magisk reinject reliability - modules-v* Forgejo release workflow + build scripts - BBC full Explore channel map including S4C - README quickstart based on release binaries
This commit is contained in:
parent
1d36961a7c
commit
f9c28be3f1
52 changed files with 2915 additions and 636 deletions
|
|
@ -5,6 +5,8 @@ import (
|
|||
|
||||
"drmdecryption/app"
|
||||
"drmdecryption/apps/streamd/internal/db"
|
||||
"drmdecryption/modhost"
|
||||
"drmdecryption/repo"
|
||||
)
|
||||
|
||||
// streamSettings are the downloader knobs for one stream. They come from the
|
||||
|
|
@ -40,23 +42,21 @@ func settingsFor(st db.Stream) streamSettings {
|
|||
TSReadyBytes: defaultTSReadyBytes,
|
||||
IsHLS: isHLS(st),
|
||||
}
|
||||
if a, err := app.Get(st.App); err == nil {
|
||||
if sd, ok := a.(app.StreamDefaults); ok {
|
||||
if s.VideoSelect == "" {
|
||||
s.VideoSelect = sd.VideoSelect()
|
||||
}
|
||||
if s.AudioSelect == "" {
|
||||
s.AudioSelect = sd.AudioSelect()
|
||||
}
|
||||
if s.Rewriter == "" {
|
||||
s.Rewriter = sd.RewriterName()
|
||||
}
|
||||
if n := sd.LiveWaitSeconds(); n > 0 {
|
||||
s.LiveWait = n
|
||||
}
|
||||
if n := sd.TSReadyBytes(); n > 0 {
|
||||
s.TSReadyBytes = n
|
||||
}
|
||||
if sd := streamDefaultsFor(st.App); sd != nil {
|
||||
if s.VideoSelect == "" {
|
||||
s.VideoSelect = sd.VideoSelect()
|
||||
}
|
||||
if s.AudioSelect == "" {
|
||||
s.AudioSelect = sd.AudioSelect()
|
||||
}
|
||||
if s.Rewriter == "" {
|
||||
s.Rewriter = sd.RewriterName()
|
||||
}
|
||||
if n := sd.LiveWaitSeconds(); n > 0 {
|
||||
s.LiveWait = n
|
||||
}
|
||||
if n := sd.TSReadyBytes(); n > 0 {
|
||||
s.TSReadyBytes = n
|
||||
}
|
||||
}
|
||||
if s.IsHLS {
|
||||
|
|
@ -79,6 +79,23 @@ func settingsFor(st db.Stream) streamSettings {
|
|||
return s
|
||||
}
|
||||
|
||||
// streamDefaultsFor prefers an external modules/<name>/ provider; falls back to
|
||||
// any in-process app.Register (used by unit tests).
|
||||
func streamDefaultsFor(name string) app.StreamDefaults {
|
||||
if name == "" {
|
||||
return nil
|
||||
}
|
||||
if a, err := modhost.Open(repo.Root(), name); err == nil {
|
||||
return a
|
||||
}
|
||||
if a, err := app.Get(name); err == nil {
|
||||
if sd, ok := a.(app.StreamDefaults); ok {
|
||||
return sd
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// isHLS reports whether a stream's manifest is an HLS playlist, by URL shape.
|
||||
// No provider host is consulted: a module declares its own needs through
|
||||
// app.StreamDefaults.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue