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
|
|
@ -1,6 +1,7 @@
|
|||
package bbc
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"time"
|
||||
|
||||
"drmdecryption/modcfg"
|
||||
|
|
@ -10,18 +11,19 @@ import (
|
|||
// Name is the module id (--app bbc).
|
||||
const Name = "bbc"
|
||||
|
||||
// Channel is one live (or catch-up) target. Phone UI selectors are optional —
|
||||
// capture works with manual play; auto-play uses them when present.
|
||||
// Channel is one live target. Label doubles as the Explore-rail content-desc
|
||||
// (e.g. "BBC One") unless ChipDesc overrides it.
|
||||
type Channel struct {
|
||||
Label string `yaml:"label"`
|
||||
// VPID is the mediaselector version/service id (e.g. bbc_one_london).
|
||||
VPID string `yaml:"vpid"`
|
||||
// ChipDesc / PlayDesc are optional UI matchers for --auto-play.
|
||||
// ChipDesc matches the channel logo on Explore (content-desc). Default: Label.
|
||||
ChipDesc []string `yaml:"chip_desc"`
|
||||
// PlayDesc matches the Watch-live control on the channel page. Default: Watch live.
|
||||
PlayDesc []string `yaml:"play_desc"`
|
||||
}
|
||||
|
||||
// Config is apps/modules/bbc/module.yaml.
|
||||
// Config is modules/bbc/module.yaml (preferred) or apps/modules/bbc/module.yaml.
|
||||
type Config struct {
|
||||
provider.Common `yaml:",inline"`
|
||||
|
||||
|
|
@ -31,30 +33,79 @@ type Config struct {
|
|||
UI UI `yaml:"ui"`
|
||||
}
|
||||
|
||||
// Timeouts for launch / optional autoplay.
|
||||
// Timeouts for launch / autoplay. Written as "25s" in module.yaml.
|
||||
type Timeouts struct {
|
||||
LaunchWaitUI provider.Duration `yaml:"launch_wait_ui"`
|
||||
LaunchSettle provider.Duration `yaml:"launch_settle"`
|
||||
Playback provider.Duration `yaml:"playback"`
|
||||
LaunchWaitUI provider.Duration `yaml:"launch_wait_ui"`
|
||||
LaunchSettle provider.Duration `yaml:"launch_settle"`
|
||||
ExploreNav provider.Duration `yaml:"explore_nav"`
|
||||
ChannelFind provider.Duration `yaml:"channel_find"`
|
||||
AfterChannel provider.Duration `yaml:"after_channel"`
|
||||
WatchLive provider.Duration `yaml:"watch_live"`
|
||||
AfterWatch provider.Duration `yaml:"after_watch"`
|
||||
Playback provider.Duration `yaml:"playback"`
|
||||
}
|
||||
|
||||
// UI markers for launch readiness (localized; keep loose).
|
||||
// UI markers for launch readiness and interactive navigation.
|
||||
type UI struct {
|
||||
LaunchDescContains []string `yaml:"launch_desc_contains"`
|
||||
LaunchResourceContains []string `yaml:"launch_resource_contains"`
|
||||
// ExploreTab is bottom-nav text/desc for the Explore page.
|
||||
ExploreTab []string `yaml:"explore_tab"`
|
||||
// WatchLive is the channel-page play control.
|
||||
WatchLive []string `yaml:"watch_live"`
|
||||
// PlaybackDescContains are soft player-up signals.
|
||||
PlaybackDescContains []string `yaml:"playback_desc_contains"`
|
||||
// ChannelScrollMax limits horizontal swipes while hunting a channel logo.
|
||||
ChannelScrollMax int `yaml:"channel_scroll_max"`
|
||||
}
|
||||
|
||||
func (c Config) withDefaults() Config {
|
||||
t := &c.Timeouts
|
||||
t.LaunchWaitUI = provider.Duration(t.LaunchWaitUI.D(30 * time.Second))
|
||||
t.LaunchSettle = provider.Duration(t.LaunchSettle.D(4 * time.Second))
|
||||
t.ExploreNav = provider.Duration(t.ExploreNav.D(20 * time.Second))
|
||||
t.ChannelFind = provider.Duration(t.ChannelFind.D(45 * time.Second))
|
||||
t.AfterChannel = provider.Duration(t.AfterChannel.D(3 * time.Second))
|
||||
t.WatchLive = provider.Duration(t.WatchLive.D(20 * time.Second))
|
||||
t.AfterWatch = provider.Duration(t.AfterWatch.D(2 * time.Second))
|
||||
t.Playback = provider.Duration(t.Playback.D(60 * time.Second))
|
||||
if len(c.UI.LaunchDescContains) == 0 {
|
||||
c.UI.LaunchDescContains = []string{"iPlayer", "Home", "Live"}
|
||||
|
||||
u := &c.UI
|
||||
if len(u.LaunchDescContains) == 0 {
|
||||
u.LaunchDescContains = []string{"Home", "Explore", "Watchlist", "Watch now", "iPlayer"}
|
||||
}
|
||||
if len(u.ExploreTab) == 0 {
|
||||
u.ExploreTab = []string{"Explore"}
|
||||
}
|
||||
if len(u.WatchLive) == 0 {
|
||||
u.WatchLive = []string{"Watch live", "Watch Live", "Watch now"}
|
||||
}
|
||||
if len(u.PlaybackDescContains) == 0 {
|
||||
u.PlaybackDescContains = []string{"Pause", "pause", "Player", "Seek", "scrubber"}
|
||||
}
|
||||
if u.ChannelScrollMax <= 0 {
|
||||
u.ChannelScrollMax = 10
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
func (ch Channel) chipPatterns() []string {
|
||||
if len(ch.ChipDesc) > 0 {
|
||||
return ch.ChipDesc
|
||||
}
|
||||
if ch.Label != "" {
|
||||
return []string{"^" + regexp.QuoteMeta(ch.Label) + "$", ch.Label}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ch Channel) playPatterns(ui UI) []string {
|
||||
if len(ch.PlayDesc) > 0 {
|
||||
return ch.PlayDesc
|
||||
}
|
||||
return ui.WatchLive
|
||||
}
|
||||
|
||||
var flags struct {
|
||||
packageName string
|
||||
caHash string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue