docs: sweep docs to zero ste_lint findings and one remote session name

This commit is contained in:
imSp4rky
2026-12-04 18:50:27 -07:00
parent 34c8fabe6f
commit 87b58190ea
34 changed files with 134 additions and 214 deletions
+24 -24
View File
@@ -3,10 +3,10 @@
A Digital Rights Management (DRM) system protects most commercial streaming titles.
To download a title and play it back, unshackle needs to get the **content keys**
for the encrypted tracks and then decrypt them. This page explains the DRM systems
unshackle supports, how to install a device so it can talk to a license server, the
unshackle supports, how to install a device so it can talk to a licence server, the
difference between local and remote CDMs, and how to choose a decryption backend.
!!! note "Who this page is for"
!!! info "Who this page is for"
This is a practical configuration guide for end users of the unshackle CLI.
A few sections have a **Developer** mark. They give internal behaviour that is
useful when you write a service, but you do not need them to download a protected
@@ -18,10 +18,10 @@ Before configuring anything, it helps to know the vocabulary. unshackle draws a
line between two things:
- A **CDM** (Content Decryption Module) is the trusted "black box" that turns a
*license challenge* into *content keys*. A **device** backs it: a file that carries
*licence challenge* into *content keys*. A **device** backs it: a file that carries
the cryptographic identity of a real client, such as a phone or a browser.
- A **DRM system** is the wrapper around a CDM that parses the protection metadata,
drives the challenge → license → keys handshake, and finally invokes an external
drives the challenge → licence → keys handshake, and finally invokes an external
tool to physically decrypt the downloaded file.
A handful of other terms show up throughout:
@@ -31,27 +31,27 @@ A handful of other terms show up throughout:
| **PSSH** | Protection System Specific Header. The per-system init data extracted from the file's init segment or the manifest. |
| **KID** | Key ID: a 16-byte UUID identifying *which* key a track needs. |
| **CEK** | Content Encryption Key: the AES content key, mapped from its KID. |
| **Challenge** | The license request the CDM produces, sent to the service's license server. |
| **License** | The server's response, which the CDM parses to recover the content keys. |
| **Challenge** | The request the CDM produces, sent to the service's licence server. |
| **Licence** | The server's response, which the CDM parses to recover the content keys. |
For a Widevine or PlayReady title, the flow is: unshackle reads the PSSH and KIDs
from the track, asks the CDM for a license challenge, sends that challenge to the
service's license server, hands the response back to the CDM to extract the keys, and
from the track, asks the CDM for a licence challenge, sends that challenge to the
service's licence server, hands the response back to the CDM to extract the keys, and
then decrypts the file with those keys.
## Supported DRM systems
unshackle has five DRM systems built in. Only the first two need a device file and a
license-server handshake. The rest are special cases. A DRM plugin adds another system (see
licence-server handshake. The rest are special cases. A DRM plugin adds another system (see
[DRM plugins](#drm-plugins)).
| System | Device file | License flow | Decryption |
| System | Device file | Licence flow | Decryption |
|--------|-------------|--------------|------------|
| **Widevine** (Google) | `.wvd` | CDM challenge → license server → CDM parses → keys | shaka-packager / mp4decrypt |
| **PlayReady** (Microsoft) | `.prd` | CDM challenge (WRM header) → license server → CDM parses → keys | shaka-packager / mp4decrypt |
| **ClearKey (CENC)**, W3C EME `org.w3.clearkey` or the W3C common PSSH | none | JSON `{"kids":[...],"type":"temporary"}` → license server returns a JWK Set. No CDM. | shaka-packager / mp4decrypt |
| **Widevine** (Google) | `.wvd` | CDM challenge → licence server → CDM parses → keys | shaka-packager / mp4decrypt |
| **PlayReady** (Microsoft) | `.prd` | CDM challenge (WRM header) → licence server → CDM parses → keys | shaka-packager / mp4decrypt |
| **ClearKey (CENC)**, W3C EME `org.w3.clearkey` or the W3C common PSSH | none | JSON `{"kids":[...],"type":"temporary"}` → licence server returns a JWK Set. No CDM. | shaka-packager / mp4decrypt |
| **ClearKey (HLS)**, AES-128 `EXT-X-KEY` | none | Key fetched directly from a URI or `data:` URL. No CDM, no challenge. | in-process AES-CBC |
| **ClearKey (CTR)**, AES-128-CTR | none | The service gives the per-track key and IV. No CDM, no license server. | in-process AES-CTR over the whole file |
| **ClearKey (CTR)**, AES-128-CTR | none | The service gives the per-track key and IV. No CDM, no licence server. | in-process AES-CTR over the whole file |
!!! warning "Three different ClearKeys"
"ClearKey (HLS)", "ClearKey (CENC)" and "ClearKey (CTR)" are entirely different systems that
@@ -213,7 +213,7 @@ The `prd` command group creates and maintains `.prd` files.
$ unshackle prd test ./data/PRDs/mydevice.prd -sl 2000 -c aesctr
```
Runs a full challenge/license/keys cycle against Microsoft's public PlayReady
Runs a full challenge/licence/keys cycle against Microsoft's public PlayReady
test server and prints the returned keys, confirming the device works.
`-sl/--security-level` accepts `150`, `2000`, or `3000` (default `2000`).
`-c/--ckt` accepts `aesctr` or `aescbc`.
@@ -300,7 +300,7 @@ profile.
A CDM can operate in two places:
- A **local CDM** loads a `.wvd` or `.prd` device from your machine and performs the
challenge/license/keys handshake locally. This is what the `cdm` mapping above
challenge/licence/keys handshake locally. This is what the `cdm` mapping above
resolves to by default.
- A **remote CDM** delegates the CDM operations to an HTTP API. Your device (and its
secrets) live on the remote CDM host. unshackle sends it PSSH/challenge data and
@@ -485,7 +485,7 @@ conditions shaka-packager is the better backend. Switch a specific service to
When an HLS playlist references a content key with an `EXT-X-KEY` tag, unshackle
fetches the content key directly (from the given URI or an inline `data:` URL) and
decrypts each segment in-process with AES-CBC. There is no device, no CDM, and no
license challenge, so you do not set anything up. unshackle decrypts such tracks
licence challenge, so you do not set anything up. unshackle decrypts such tracks
automatically during download.
The `EXT-X-KEY` URI must return a content key of exactly 16 bytes, or the download stops with an error.
@@ -494,7 +494,7 @@ logs one warning for the track, because the content key is possibly wrong.
### ClearKey over CENC (W3C EME `org.w3.clearkey`)
The CENC ClearKey scheme is a proper license flow, but the "license server"
The CENC ClearKey scheme is a proper licence flow, but the "licence server"
returns the keys as a JWK Set and not a DRM-wrapped blob. unshackle builds a W3C
EME request of the form:
@@ -502,22 +502,22 @@ EME request of the form:
{"kids": ["<base64url-kid>", ...], "type": "temporary"}
```
It sends this to the manifest's license URL (or to whatever a service's ClearKey
license hook returns) and reads the JSON Web Key set back. You do not need a device
It sends this to the manifest's licence URL (or to whatever a service's ClearKey
licence hook returns) and reads the JSON Web Key set back. You do not need a device
file. The decrypted file still goes through shaka-packager or mp4decrypt like any
other CENC track, so the `decryption` setting applies.
A DASH manifest can also give the KID of a ClearKey track with only the W3C common PSSH
(`urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b`). The common PSSH can name KIDs for any DRM
system, so unshackle reads it as ClearKey (CENC) only when the manifest and the init segment
give no other DRM system. This scheme has no license URL in the manifest, so the content key
must come from the service's ClearKey license hook or from a key vault.
give no other DRM system. This scheme has no licence URL in the manifest, so the content key
must come from the service's ClearKey licence hook or from a key vault.
### ClearKey over a whole file (AES-CTR)
Some services encrypt one whole audio file with AES-128-CTR and give the content key and
the IV with the track. unshackle decrypts the file in-process after the download. There is
no device, no CDM and no license challenge. The licence step of a download or of a `--skip-dl` run licenses
no device, no CDM and no licence challenge. The licence step of a download or of a `--skip-dl` run licenses
the content key, so `--list` asks for none. The IV, the length of the header in front of the media and the
signature the file must start with travel with the track list.
@@ -670,7 +670,7 @@ debug_requests: true
```
!!! warning "Keys and paths in logs"
When you enable key logging, unshackle writes content keys (KID:key pairs) to the logs.
When you enable key logging, unshackle writes content keys (`KID:KEY`) to the logs.
Treat those logs as sensitive. The unrelated `redact_paths` option (default
`true`) masks local directory paths in log output.