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
15
modules/tg4/go.mod
Normal file
15
modules/tg4/go.mod
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
module null-drm/modules/tg4
|
||||
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
drmdecryption v0.0.0
|
||||
drmdecryption/modules v0.0.0
|
||||
)
|
||||
|
||||
require gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
|
||||
replace (
|
||||
drmdecryption => ../../apps/pkg
|
||||
drmdecryption/modules => ../../apps/modules
|
||||
)
|
||||
4
modules/tg4/go.sum
Normal file
4
modules/tg4/go.sum
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
170
modules/tg4/main.go
Normal file
170
modules/tg4/main.go
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
// Command tg4 is the external TG4 provider module.
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"drmdecryption/adb"
|
||||
appreg "drmdecryption/app"
|
||||
"drmdecryption/modcfg"
|
||||
"drmdecryption/modhost"
|
||||
"drmdecryption/modules/tg4"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if len(os.Args) < 2 {
|
||||
usage()
|
||||
os.Exit(2)
|
||||
}
|
||||
cmd, args := os.Args[1], os.Args[2:]
|
||||
var err error
|
||||
switch cmd {
|
||||
case "describe":
|
||||
err = cmdDescribe()
|
||||
case "launch":
|
||||
err = cmdLaunch(args)
|
||||
case "autoplay":
|
||||
err = cmdAutoplay(args)
|
||||
case "catalog":
|
||||
err = cmdCatalog(args)
|
||||
case "help", "-h", "--help":
|
||||
usage()
|
||||
return
|
||||
default:
|
||||
usage()
|
||||
err = fmt.Errorf("unknown command %q", cmd)
|
||||
}
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "[!]", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func usage() {
|
||||
fmt.Fprint(os.Stderr, `tg4 — Null DRM external module (TG4)
|
||||
|
||||
Usage:
|
||||
tg4 describe
|
||||
tg4 launch [--serial SERIAL]
|
||||
tg4 autoplay --channel ID [--serial SERIAL]
|
||||
tg4 catalog --channel ID [--json]
|
||||
`)
|
||||
}
|
||||
|
||||
func loadApp() (appreg.App, error) {
|
||||
return tg4.New()
|
||||
}
|
||||
|
||||
func cmdDescribe() error {
|
||||
a, err := loadApp()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
d := modhost.Describe{
|
||||
Protocol: modhost.ProtocolVersion,
|
||||
Name: a.Name(),
|
||||
Package: a.Package(),
|
||||
LicenseURL: a.LicenseURL(),
|
||||
KeyMode: a.KeyMode(),
|
||||
ProxyBin: a.ProxyBin(),
|
||||
CAHash: a.CAHash(),
|
||||
TransparentMITM: false,
|
||||
Rewriter: "none",
|
||||
ValuesPath: modcfg.Path(a.Name()),
|
||||
}
|
||||
if sd, ok := a.(appreg.StreamDefaults); ok {
|
||||
d.Rewriter = sd.RewriterName()
|
||||
}
|
||||
type loaded interface {
|
||||
ConfigLoaded() bool
|
||||
ConfigPath() string
|
||||
}
|
||||
if L, ok := a.(loaded); ok {
|
||||
d.ValuesLoaded = L.ConfigLoaded()
|
||||
if L.ConfigPath() != "" {
|
||||
d.ValuesPath = L.ConfigPath()
|
||||
}
|
||||
}
|
||||
if _, ok := a.(appreg.Catalog); ok {
|
||||
d.HasCatalog = true
|
||||
}
|
||||
h := a.CaptureHints()
|
||||
d.Require = h.Require
|
||||
d.Score = h.Score
|
||||
for _, ch := range a.Channels() {
|
||||
d.Channels = append(d.Channels, modhost.Channel{ID: ch.ID, Label: ch.Label})
|
||||
}
|
||||
enc := json.NewEncoder(os.Stdout)
|
||||
enc.SetIndent("", " ")
|
||||
return enc.Encode(d)
|
||||
}
|
||||
|
||||
func cmdLaunch(args []string) error {
|
||||
fs := flag.NewFlagSet("launch", flag.ContinueOnError)
|
||||
serial := fs.String("serial", "", "adb device serial")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
a, err := loadApp()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c := adb.New()
|
||||
if *serial != "" {
|
||||
c = c.WithSerial(*serial)
|
||||
}
|
||||
return a.Launch(c)
|
||||
}
|
||||
|
||||
func cmdAutoplay(args []string) error {
|
||||
fs := flag.NewFlagSet("autoplay", flag.ContinueOnError)
|
||||
serial := fs.String("serial", "", "adb device serial")
|
||||
channel := fs.String("channel", "", "channel id")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
if *channel == "" {
|
||||
return fmt.Errorf("--channel is required")
|
||||
}
|
||||
a, err := loadApp()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c := adb.New()
|
||||
if *serial != "" {
|
||||
c = c.WithSerial(*serial)
|
||||
}
|
||||
return a.AutoPlay(c, *channel)
|
||||
}
|
||||
|
||||
func cmdCatalog(args []string) error {
|
||||
fs := flag.NewFlagSet("catalog", flag.ContinueOnError)
|
||||
channel := fs.String("channel", "", "channel id")
|
||||
asJSON := fs.Bool("json", false, "print JSON")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
if *channel == "" {
|
||||
return fmt.Errorf("--channel is required")
|
||||
}
|
||||
a, err := loadApp()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cat, ok := a.(appreg.Catalog)
|
||||
if !ok {
|
||||
return fmt.Errorf("tg4 module has no catalog")
|
||||
}
|
||||
info, err := cat.Resolve(*channel)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if *asJSON {
|
||||
return json.NewEncoder(os.Stdout).Encode(info)
|
||||
}
|
||||
fmt.Printf("mpd: %s\n", info.MPD)
|
||||
return nil
|
||||
}
|
||||
64
modules/tg4/module-publish.yaml
Normal file
64
modules/tg4/module-publish.yaml
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
# TG4 — published universal values (renamed to module.yaml in release zips).
|
||||
# Fill secrets in local module.yaml: account_id, policy_key, playback_config_url,
|
||||
# and per-channel video_id / token_field / stream_id_field (never commit that file).
|
||||
|
||||
package: ie.bytes.tg4.tg4videoapp
|
||||
proxy_bin: bin/proxy-android-arm64
|
||||
|
||||
# SENSITIVE — set in local module.yaml:
|
||||
# account_id: "…"
|
||||
# policy_key: "…"
|
||||
# playback_config_url: "https://…"
|
||||
|
||||
score:
|
||||
hosts:
|
||||
- fastly.live.brightcove.com
|
||||
deny:
|
||||
- metrics.brightcove
|
||||
- gnsnpaw.com
|
||||
|
||||
aliases:
|
||||
tg4: ioi
|
||||
live: ioi
|
||||
ireland: ioi
|
||||
cula: cula4
|
||||
plus1: plus
|
||||
"tg4+": plus
|
||||
tg4plus: plus
|
||||
worldwide: ww
|
||||
tg4sport: sport
|
||||
sporttg4: sport
|
||||
|
||||
channels:
|
||||
ioi:
|
||||
label: "TG4 (IOI)"
|
||||
live_card_index: 0
|
||||
# video_id / token_field / stream_id_field → local module.yaml
|
||||
cula4:
|
||||
label: "Cúla4"
|
||||
live_card_index: 1
|
||||
plus:
|
||||
label: "TG4+1"
|
||||
live_card_index: 2
|
||||
sport:
|
||||
label: "Sport TG4"
|
||||
phone_only: true
|
||||
live_card_index: 3
|
||||
ww:
|
||||
label: "TG4 Worldwide"
|
||||
live_card_index: 0
|
||||
|
||||
ui:
|
||||
launch_resource_contains:
|
||||
- rails_swipe_refresh_layout
|
||||
- fragment_drawer_toolbar
|
||||
live_label: live
|
||||
playback_desc_contains: ["video player"]
|
||||
playback_resource_contains: ["brightcove_video_view"]
|
||||
|
||||
timeouts:
|
||||
launch_wait_ui: 30s
|
||||
launch_settle: 4s
|
||||
live_nav: 25s
|
||||
card: 30s
|
||||
playback: 45s
|
||||
Loading…
Add table
Add a link
Reference in a new issue