feat(drm)!: load DRM systems beyond the built-ins from plugins in directories.plugins

This commit is contained in:
imSp4rky
2026-12-03 15:51:42 -07:00
parent f8a248a29e
commit e9adc50594
65 changed files with 1651 additions and 2526 deletions
+2 -3
View File
@@ -448,7 +448,7 @@ least one and no track is left.
## DRM hooks
If a track carries DRM, the framework licenses and decrypts it, but it needs your
service to talk to the platform's license server. unshackle recognizes seven DRM systems:
service to talk to the platform's license server. unshackle recognizes six DRM classes:
| DRM class | System | License flow |
|---|---|---|
@@ -456,8 +456,7 @@ service to talk to the platform's license server. unshackle recognizes seven DRM
| `PlayReady` | PlayReady | CDM challenge (WRM header) → license server → content keys (`.prd` device) |
| `ClearKeyCENC` | W3C `org.w3.clearkey` or W3C common PSSH over CENC | JSON KID request → JWK set; no CDM |
| `ClearKey` | HLS AES-128 | content key fetched directly from a URI; no CDM, no challenge |
| `MonaLisa` | Proprietary WASM DRM | keys extracted locally; no license server. Without `tool_path`, core uses `bbtsdecrypt` per segment, else its built-in decrypter (`core/drm/bbts.py`) per segment. `command_builder` sets the command of the decryption backend, and `segment_decrypt=False` runs it once on the merged file. Over `--remote` only the KID goes to the client, and the server sends the content key under the server CDM. An export also holds only the KID as its DRM, never the tool or the command. One process extracts the keys of one ticket at a time, because the wasmtime bindings are not thread-safe |
| `BlowfishStripe` | Blowfish CBC stripe cipher | the service gives the per-track key; no CDM, no license server |
| `CustomDRM` | a system that a DRM plugin adds | `CustomDRM("<plugin id>", kids=..., data=...)`. For a plugin that holds its key, put the key in `data`. For a plugin that licenses locally, call `drm.license(cdm)` with a device of the plugin from `load_cdm`. The plugin decrypts. Its README names the `data` it reads |
| `ClearKeyCTR` | AES-128-CTR over a whole file | the service gives the IV and licenses the content key at the licence step; no CDM, no license server |
!!! warning "`ClearKey` vs `ClearKeyCENC`"