# dashdrm-mp4ff Custom Streamlink plugin for DRM-protected MPEG-DASH streams. This project is based on [titus-au/streamlink-plugin-dashdrm](https://github.com/titus-au/streamlink-plugin-dashdrm), which itself is based on Streamlink's [`dash.py`](https://github.com/streamlink/streamlink/blob/master/src/streamlink/stream/dash/dash.py). ## Install `mp4ff-decrypt` ```bash go install github.com/Eyevinn/mp4ff/cmd/mp4ff-decrypt@latest ``` Make sure the Go bin directory is in your `PATH`, then verify: ```bash mp4ff-decrypt -h ``` If you do not want to use `mp4ff-decrypt`, you can still use the plugin without `--dashdrm-mp4ff-use-mp4ff`. ## Usage Run Streamlink with the local plugin directory: ```bash streamlink --plugin-dirs "plugin" "dashdrm://https://example.com/live.mpd" best ``` With `mp4ff-decrypt` and `kid:key` pairs: ```bash streamlink \ --plugin-dirs "plugin" \ --dashdrm-mp4ff-use-mp4ff \ --dashdrm-mp4ff-decryption-key "kid1:key1,kid2:key2,kid3:key3" \ "dashdrm://https://example.com/live.mpd" \ best ``` Notes: - Keys can be provided as raw keys or as `kid:key`. - When `kid:key` pairs are provided, the plugin parses the manifest and matches each track with the correct key. - The plugin file is [`plugin/dashdrm_mp4ff.py`](./plugin/dashdrm_mp4ff.py). ## `gen.py` [`gen.py`](./gen.py) is a small helper that reads channels from `vault.json`, lets you pick one interactively, and prints the full Streamlink command. Install the helper dependency: ```bash uv sync ``` Create your own `vault.json` from [`vault.json.example`](./vault.json.example), then run: ```bash python gen.py ``` The expected structure is: ```json { "channels": [ { "id": "channel-id", "number": "1", "name": "Channel name", "mpd_url": "https://example.com/live.mpd", "keys": [ "kid1:key1", "kid2:key2" ] } ] } ```