mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-02 05:55:08 +00:00
Deployed 7a5bac78 with MkDocs version: 1.6.1
This commit is contained in:
@@ -3070,7 +3070,7 @@ current <code>title</code> and <code>track</code>:</p>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>A license callback can also declare optional keyword arguments. <code>get_widevine_license</code> can ask for <code>pssh</code> and <code>session_id</code>. <code>get_playready_license</code> can ask for <code>pssh_b64</code> and <code>session_id</code>. <code>session_id</code> is the open CDM session. A callback gets only the arguments that its signature declares.</p>
|
||||
<p>A license callback can also declare optional keyword arguments. <code>get_widevine_license</code> can ask for <code>pssh</code> and <code>session_id</code>. <code>get_playready_license</code> can ask for <code>pssh_b64</code> and <code>session_id</code>. <code>session_id</code> is the open CDM session. A callback gets only the arguments that its signature declares. When a <code>--remote</code> client licenses with its own CDM, the callback on the server gets <code>pssh</code> or <code>pssh_b64</code> for the header the client licenses, but no <code>session_id</code>.</p>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-21-1"><a id="__codelineno-21-1" name="__codelineno-21-1" href="#__codelineno-21-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_widevine_license</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="p">,</span> <span class="n">challenge</span><span class="p">:</span> <span class="nb">bytes</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">track</span><span class="p">):</span>
|
||||
</span><span id="__span-21-2"><a id="__codelineno-21-2" name="__codelineno-21-2" href="#__codelineno-21-2"></a> <span class="n">response</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">session</span><span class="o">.</span><span class="n">post</span><span class="p">(</span>
|
||||
</span><span id="__span-21-3"><a id="__codelineno-21-3" name="__codelineno-21-3" href="#__codelineno-21-3"></a> <span class="bp">self</span><span class="o">.</span><span class="n">license_data</span><span class="p">[</span><span class="s2">"url"</span><span class="p">],</span>
|
||||
|
||||
@@ -5452,7 +5452,7 @@ A slow answer arrives as a <a href="#slow-responses">slow response</a>.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>pssh</code></td>
|
||||
<td>Base64 PSSH (server-CDM mode).</td>
|
||||
<td>Base64 PSSH. Server-CDM mode licenses this PSSH. Proxy mode gives it to the service licence callback as <code>pssh</code> (Widevine) or <code>pssh_b64</code> (PlayReady), the PSSH of the header the challenge is for. A proxy-mode PSSH that names a KID the track does not carry goes to no callback.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>drm_type</code></td>
|
||||
|
||||
@@ -3140,8 +3140,9 @@ least one and no track is left.</p>
|
||||
<h3 id="segment-filtering-hooks">Segment-filtering hooks<a class="headerlink" href="#segment-filtering-hooks" title="Permanent link">¶</a></h3>
|
||||
<ul>
|
||||
<li><strong>HLS</strong>: set <code>track.OnSegmentFilter(segment)</code> to drop unwanted segments (ads/bumpers).
|
||||
An <code>EXT-X-KEY</code> applies to each later segment until the next <code>EXT-X-KEY</code>, also when the
|
||||
filter or <code>--sample</code> drops the segment that carries it. unshackle ignores an <code>EXT-X-KEY</code> that
|
||||
An <code>EXT-X-KEY</code> applies to each later segment until the next <code>EXT-X-KEY</code> with the same
|
||||
<code>KEYFORMAT</code>, or with another <code>METHOD</code>, also when the filter or <code>--sample</code> drops the segment
|
||||
that carries it. <code>METHOD=NONE</code> ends every <code>EXT-X-KEY</code>. unshackle ignores an <code>EXT-X-KEY</code> that
|
||||
applies to dropped segments only: no licence, no request and no new decryption. It also
|
||||
ignores the <code>EXT-X-DISCONTINUITY</code> of a dropped segment. A dropped ad break thus does not
|
||||
disturb decryption when the playlist repeats the <code>EXT-X-KEY</code> of the title after the break.
|
||||
@@ -3289,21 +3290,33 @@ these conditions are true:</p>
|
||||
<ul>
|
||||
<li>The track has no DRM object.</li>
|
||||
<li>Every <code>EXT-X-KEY</code> of its media playlist is <code>SAMPLE-AES</code> or <code>SAMPLE-AES-CTR</code> for a DRM system
|
||||
unshackle cannot license.</li>
|
||||
unshackle cannot license, or <code>METHOD=NONE</code>. A segment under <code>METHOD=NONE</code> must have an init segment
|
||||
that no encrypted segment uses: a decrypter that reads the encrypted init segment decrypts the clear
|
||||
samples too. A tag with <code>KEYFORMAT="identity"</code>, or with no <code>KEYFORMAT</code>, names no DRM system: each
|
||||
encrypted segment also needs a tag of a DRM system.</li>
|
||||
<li>The configured CDM is a PlayReady or Widevine CDM.</li>
|
||||
<li>The init segment (<code>EXT-X-MAP</code>) of the track names a key ID in its <code>tenc</code> box. When the <code>tenc</code> key ID is all
|
||||
zeros, its <code>pssh</code> boxes must name exactly one key ID, and the encrypted segments must have one init
|
||||
segment and the playlist one key URI. MPEG-TS media has no init segment.</li>
|
||||
zeros, the playlist must have one key URI, and each init segment under the key tag must give the same
|
||||
key ID: its <code>tenc</code> key ID, or else the one key ID that its <code>pssh</code> boxes name. A clear init segment,
|
||||
such as the one of a clear lead or tail, does not count. MPEG-TS media has no init segment.</li>
|
||||
<li>The init segment does not change without an <code>EXT-X-DISCONTINUITY</code>.</li>
|
||||
</ul>
|
||||
<p>The download reads the key ID from the init segment, builds a DRM object for the DRM system of the
|
||||
CDM with <code>drm_stub</code>, and sends the challenge to the licence callback of the service. Over <code>--remote</code>
|
||||
the server reads the same key ID at the licence step, so it accepts the DRM object of the client. A
|
||||
licence that gives no content key stops the track before it downloads a segment.</p>
|
||||
<p>unshackle reads one key ID from each init segment. So it licenses a playlist that changes its content key
|
||||
correctly only when each content key has its own init segment with a real <code>tenc</code> key ID, after an
|
||||
<code>EXT-X-DISCONTINUITY</code>. When the first key ID is real, the download also reads the <code>tenc</code> key ID of
|
||||
each other init segment of the encrypted segments, and licenses each real key ID in its own licence step. A
|
||||
PlayReady DRM object then has one header for each key ID, because the header of <code>drm_stub</code> holds
|
||||
one key ID. A key ID that gets no content key stops the track before it downloads a segment. An
|
||||
init segment that gives no real key ID does not count.</p>
|
||||
<p>A service that must choose the DRM system itself, or one that knows the key ID, puts the DRM object
|
||||
on the track:</p>
|
||||
<ol>
|
||||
<li>Read the key ID from the init segment of the track. <code>HLS.get_track_kid_from_init</code> returns it.</li>
|
||||
<li>Read the key ID from the init segment of the track. <code>HLS.get_track_kid_from_init</code> returns it. It reads
|
||||
the first init segment of the playlist, unless you give it the init segment of the encrypted segments.</li>
|
||||
<li>Put a DRM object that names the key ID on the track: <code>drm_stub</code> from <code>unshackle.core.drm.cenc</code>
|
||||
with <code>"playready"</code> or <code>"widevine"</code> and the key ID. When only one of the two systems issues the
|
||||
content key, also set <code>track.drm_preference</code> to it.</li>
|
||||
@@ -3313,7 +3326,8 @@ on the track:</p>
|
||||
by the key ID, not with one that checks a header a packager signed. A platform can issue the
|
||||
content key of one package of a title and refuse another. When a track carries a Widevine or PlayReady DRM
|
||||
object and every <code>EXT-X-KEY</code> of its playlist is <code>SAMPLE-AES</code> or <code>SAMPLE-AES-CTR</code> for a key system
|
||||
unshackle cannot license, <code>HLS.drop_unsupported_keys</code> removes the tags from the parsed playlist.
|
||||
unshackle cannot license, or <code>METHOD=NONE</code> under the same condition, <code>HLS.drop_unsupported_keys</code> removes the
|
||||
tags from the parsed playlist.
|
||||
The download then licenses and decrypts the track with the DRM object of the track. This works for
|
||||
one content key per track: the key changes of the playlist go with the tags. This limit also
|
||||
applies to a DRM object that the download builds. Any other track stops with
|
||||
|
||||
@@ -2726,8 +2726,13 @@ appropriate one for each track.</p>
|
||||
<p class="admonition-title">HLS tracks with only a FairPlay key tag</p>
|
||||
<p>unshackle has no FairPlay CDM. When each <code>EXT-X-KEY</code> of an fMP4 playlist is sample encryption
|
||||
for a DRM system that unshackle cannot license, such as FairPlay, unshackle reads the key ID from
|
||||
the init segment and asks for the licence with your PlayReady or Widevine device. This works
|
||||
only when the licence server of the platform also issues that content key for that DRM system. MPEG-TS SAMPLE-AES stops with an error.</p>
|
||||
the init segment and asks for the licence with your PlayReady or Widevine device. unshackle reads one
|
||||
key ID from each init segment. So it licenses a playlist that changes its content key correctly only
|
||||
when each content key has its own init segment with a real key ID, after an <code>EXT-X-DISCONTINUITY</code>. This works
|
||||
only when the licence server of the platform also issues that content key for that DRM system. MPEG-TS SAMPLE-AES stops with an error.
|
||||
Each key ID must name one content key: a playlist that encrypts two blocks with two content keys under
|
||||
one key ID gives wrong frames. A clear part under <code>METHOD=NONE</code> must have its own init segment, or the
|
||||
track stops with an error.</p>
|
||||
</div>
|
||||
<div class="admonition info">
|
||||
<p class="admonition-title">Obtaining device files</p>
|
||||
|
||||
@@ -2736,7 +2736,7 @@
|
||||
</div>
|
||||
<div class="admonition example">
|
||||
<p class="admonition-title">A vault served a wrong content key</p>
|
||||
<p><strong>Symptom:</strong> a warning names a content key and the vault it came from, either <code>was bad, trying other vaults</code> (the decode check failed) or <code>is flagged bad, skipping</code> (an earlier run flagged it). The download stops with <code>The content key from the vault did not decrypt the track; run again</code>, <code>was bad and no other source has the key</code>, or <code>No vault or CDM produced a content key that decrypts the track</code> when no source is left to try.</p>
|
||||
<p><strong>Symptom:</strong> a warning names a content key and the vault it came from, either <code>was bad, trying other vaults</code> (the decode check failed) or <code>is flagged bad, skipping</code> (an earlier run flagged it). The download stops with <code>The content key from the vault did not decrypt the track; run again</code>, <code>was bad and no other source has the key</code>, or <code>No vault or CDM produced a content key that decrypts the track</code> when no source is left to try. If the licence returns the same content key that the check flagged, unshackle keeps the key and the download continues. The warning <code>Licence returned the same content key for KID <kid>, keeping it</code> then shows that the decode check failed for a different cause.</p>
|
||||
<p><strong>Inspect:</strong> while it decrypts a track whose content key came from a vault, unshackle keeps the ciphertext as a <code>.enc</code> sibling of the track file in the temp directory, and removes it afterwards; a leftover one is from a killed run and is safe to delete. Read the <code>bad_keys</code> table of your local SQLite vault to see which pairs are flagged and which vault each came from. See <a href="../vaults/#wrong-keys-from-a-poisoned-vault">Wrong keys from a poisoned vault</a>.</p>
|
||||
</div>
|
||||
<div class="admonition example">
|
||||
|
||||
@@ -9007,7 +9007,7 @@ of <code>get_init_segment</code> to find the Key ID.</p>
|
||||
|
||||
<p>Load the Widevine and PlayReady DRM of the EXT-X-KEY and EXT-X-SESSION-KEY tags of this track's playlist.</p>
|
||||
<p>It skips a tag that gives no DRM, and raises ValueError when the fetch fails or when every such tag fails.
|
||||
With <code>bridge</code> it builds both stubs for the key ID that <code>HLS.get_bridge_kid</code> finds when no tag gives a DRM.</p>
|
||||
With <code>bridge</code> it builds both stubs for the key IDs that <code>HLS.get_bridge_kids</code> finds when no tag gives a DRM.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
File diff suppressed because one or more lines are too long
+38
-38
@@ -2,154 +2,154 @@
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/creating-a-service/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/service-architecture/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/authentication/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/dashboard/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/endpoints/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/errors/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/job-lifecycle/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/quickstart/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/remote-sessions/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/getting-started/configuration-file/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/getting-started/installation/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/getting-started/quickstart/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/cli-reference/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/downloading/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/drm-and-cdm/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/output-and-naming/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/proxies-and-vpn/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/subtitles/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/troubleshooting/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/vaults/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/config/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/drm/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/service/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/titles/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/tracks/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/directories/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/download/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/drm/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/example/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/misc/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/network/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/output/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/post-scripts/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/services/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/vaults/</loc>
|
||||
<lastmod>2026-12-01</lastmod>
|
||||
<lastmod>2026-12-02</lastmod>
|
||||
</url>
|
||||
</urlset>
|
||||
Binary file not shown.
Reference in New Issue
Block a user