Null-DRM-Official/apps/streamd/README.md
404errordeveloper ac8701b5a6
All checks were successful
release / build-and-upload (push) Successful in 6m20s
modules-release / build-and-upload (push) Successful in 4m51s
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
2026-10-09 00:17:23 +02:00

67 lines
2.5 KiB
Markdown

# streamd
Control plane: REST API, SQLite, dashboard and media supervisor. Hosted by the
single binary as `drm serve`.
```text
apps/streamd/
servecmd/ the command body, imported by apps/cli
internal/api HTTP handlers
internal/db SQLite store
internal/ui dashboard (index.html, app.js, app.css)
internal/supervisor downloader + ffmpeg supervision
internal/ws agent heartbeat
```
## Run
```bash
./bin/drm serve --bind 127.0.0.1:8083 --data .cache/streamd --token SECRET
```
Port 8083 by default, to stay clear of anything already on 8080/8081. On start,
missing media tools are downloaded into `bin/` (ffmpeg, N_m3u8DL-RE, mp4decrypt)
unless you pass `--skip-deps`. Flags / env still win when set.
Open `http://HOST:8083/` and put the token in the header box for mutating actions.
Add a stream with an `.mpd` URL; Widevine keys are optional for clear content.
Optional per-stream SOCKS5/HTTP `proxy` routes origin fetches (geo egress).
## API
| Method | Path | Notes |
|---|---|---|
| GET | `/api/health` | liveness + uptime |
| GET | `/api/apps` | modules/<name>/ providers, channels, registered rewriters |
| GET | `/api/streams` | list + runtime (the agent polls this) |
| POST | `/api/streams` | create |
| GET/PATCH/DELETE | `/api/streams/:id` | detail / edit / delete |
| POST | `/api/streams/:id/start\|stop\|restart` | desired state |
| POST | `/api/streams/:id/credentials` | `{mpd,key?,pssh?,auth?,pid?}` — key optional; restarts if enabled |
| POST | `/api/streams/:id/claim` | agent lease (`agent_id`, TTL ~3m) |
| POST | `/api/streams/:id/claim/release` | release lease |
Mutating routes need `Authorization: Bearer TOKEN` (or `X-Streamd-Token`, or
`?token=`). HLS output is served from `--data/www` at `/hls/<name>/index.m3u8`.
## No provider knowledge
The schema has no provider defaults, and the dashboard's app/channel pickers come
from `/api/apps`. Per-stream downloader settings resolve at start time:
```text
stored row -> the stream's app module (app.StreamDefaults) -> neutral defaults
```
The manifest rewriter is a registry lookup on the stream's `rewriter` column, and
HLS is detected from the manifest shape — not from an app or stream name.
## Status
| Area | State |
|---|---|
| serve + SQLite + CRUD UI + claims + credentials | done |
| `/api/apps` + module-driven defaults | done |
| Real downloader/ffmpeg workers + playlist health | partial — least exercised path |
**Full guide: [docs/streamd.md](../../docs/streamd.md)**