mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-02 05:55:08 +00:00
Deployed c7a3febf with MkDocs version: 1.6.1
This commit is contained in:
@@ -5541,7 +5541,7 @@ A slow answer arrives as a <a href="#slow-responses">slow response</a>.</p>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="post-apisessionsession_idkeys"><code>POST /api/session/{session_id}/keys</code><a class="headerlink" href="#post-apisessionsession_idkeys" title="Permanent link">¶</a></h3>
|
||||
<p>Store the content keys that the client proved on a track and that the server did not serve to this remote session. The server stores a content key only for a KID that a track of the remote session names and that no local server vault holds a content key for. It never stores a pair flagged bad, and it never removes a flag. The server answers when its local vaults hold the pairs, and sends them to its other vaults after the answer. The client sends each key of a licence when the licence returns, and each vault key after its decode check passes.</p>
|
||||
<p>Store the content keys that the client proved on a track and that the server did not serve to this remote session. The server stores a content key only for a KID that a track of the remote session names and that no local server vault holds a content key for. It never stores a pair flagged bad, and it never removes a flag. The server answers when its local vaults hold the pairs, and sends them to its other vaults after the answer. The client sends each key of a licence when the licence returns, and each vault key after its decode check passes. A licence key of a FairPlay-only track that the client licensed through the bridge goes only after its decode check passes, so a client without FFmpeg does not send it.</p>
|
||||
<div class="language-json highlight"><pre><span></span><code><span id="__span-46-1"><a id="__codelineno-46-1" name="__codelineno-46-1" href="#__codelineno-46-1"></a><span class="p">{</span><span class="w"> </span><span class="nt">"track_id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"<track_id>"</span><span class="p">,</span><span class="w"> </span><span class="nt">"keys"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">"<kid_hex>"</span><span class="p">:</span><span class="w"> </span><span class="s2">"<key_hex>"</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span>
|
||||
</span></code></pre></div>
|
||||
<table>
|
||||
|
||||
@@ -3331,6 +3331,8 @@ such a track out of the selection:</p>
|
||||
or each selected audio track is FairPlay-only, <code>dl</code> skips the title.</li>
|
||||
<li><code>--list</code> shows every track and checks none. An import is not checked, because its export holds the
|
||||
content keys.</li>
|
||||
<li>With the hook, <code>dl</code> still leaves out FairPlay-only DASH tracks, because the bridge works for HLS only.
|
||||
The line then reads <code>Left out 1 FairPlay-only track: DASH has no FairPlay bridge</code>.</li>
|
||||
</ul>
|
||||
<p>A licence server that does not issue the content key refuses the challenge, and can flag the device. Test
|
||||
the route with a licence-only run (<code>--cdm-only --skip-dl</code>) before a service relies on it.</p>
|
||||
@@ -3405,6 +3407,9 @@ The download then licenses and decrypts the track with the DRM object of the tra
|
||||
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
|
||||
<code>None of the key systems are supported</code> before it downloads a segment.</p>
|
||||
<p>A DASH track with no DRM object stops with the same error when its init segment has an encrypted
|
||||
sample entry. A DASH track with no init segment stops after the download when the file has one, and
|
||||
unshackle deletes the file. A service sample decrypter turns off both checks.</p>
|
||||
<h3 id="how-unshackle-chooses-a-cdm-and-finds-keys">How unshackle chooses a CDM and finds keys<a class="headerlink" href="#how-unshackle-chooses-a-cdm-and-finds-keys" title="Permanent link">¶</a></h3>
|
||||
<p>CDM selection is config-driven: the <code>cdm</code> map resolves a service tag (and optionally the
|
||||
track quality or DRM type) to a device name, which <code>load_cdm</code> instantiates as a local
|
||||
|
||||
@@ -2723,7 +2723,7 @@ The differences that matter to you are:</p>
|
||||
need a <code>.prd</code> device. You can hold both, and unshackle automatically selects the
|
||||
appropriate one for each track.</p>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">HLS tracks with only a FairPlay key tag</p>
|
||||
<p class="admonition-title">Tracks with only FairPlay protection</p>
|
||||
<p>unshackle has no FairPlay CDM and never sends a FairPlay challenge.
|
||||
For a FairPlay-only track it can send a PlayReady or Widevine challenge for the KIDs of the init
|
||||
segments to the licence server of the platform, which works only when that server issues the same
|
||||
@@ -2732,7 +2732,11 @@ Only a service that defines this route does it. For another service, unshackle l
|
||||
tracks out of the selection and takes the next best track that licenses, with one line:
|
||||
<code>Left out 1 FairPlay-only track: EXAMPLE has no FairPlay bridge hook</code>. When only FairPlay-only tracks
|
||||
match your quality or range options, unshackle skips the title, unless you use <code>--best-available</code>.
|
||||
<code>--list</code> still shows every track.
|
||||
<code>--list</code> still shows every track.</p>
|
||||
<p>The route works for HLS only, so a service that defines it still loses its FairPlay-only DASH tracks:
|
||||
<code>Left out 1 FairPlay-only track: DASH has no FairPlay bridge</code>.
|
||||
An encrypted DASH track with no DRM system that unshackle can license stops with
|
||||
<code>None of the key systems are supported</code>, and unshackle keeps no output file.
|
||||
A licence without the content key of a key ID, or with a content key that does not decrypt the
|
||||
track, stops the download of that track with an error, and unshackle keeps no output file.</p>
|
||||
<p>When each <code>EXT-X-KEY</code> of an fMP4 playlist is sample encryption
|
||||
|
||||
@@ -2404,7 +2404,7 @@
|
||||
</ul>
|
||||
<p>unshackle pushes keys from every source, not only a local CDM. A run against a remote server that licenses with its own CDM (<code>--remote</code>) writes the keys the server returns, and <code>unshackle import</code> writes the keys it reads from an export file.</p>
|
||||
<h3 id="wrong-keys-from-a-poisoned-vault">Wrong keys from a poisoned vault<a class="headerlink" href="#wrong-keys-from-a-poisoned-vault" title="Permanent link">¶</a></h3>
|
||||
<p>A public vault can return the right KID with a wrong content key. The decrypters accept a wrong content key and write noise. unshackle therefore trusts a content key from a vault only after FFmpeg decodes the decrypted track with strict error detection. For a fragmented MP4, unshackle reads from the encrypted file which fragments each KID encrypts, and FFmpeg decodes up to three windows of each KID: from its first, middle and last fragment on through the next fragments of that KID, for up to 4 seconds. A window never runs into a fragment of another KID or a clear fragment. A clear lead or a lead under another KID therefore cannot hide a wrong content key, and only the KID that fails is flagged. When every KID in the map has a content key, the map is complete, and a KID that is not in it does not encrypt this file. This file does not judge that KID; the file of its own track judges it. A file with no encrypted sample entry and no encrypted fragment, for example a clear audio track, judges no KID, so it neither flags nor copies a content key. A KID that is not in an incomplete map, for example one with an all-zero KID, and every KID of any other file, gets one check of the whole file. FFmpeg decodes the first seconds and the last seconds. A failure there flags each of those KIDs. When a mapped KID fails, the KIDs that are not in the map get no verdict from that pass; the retry with the replaced key judges them. Content keys from a licence skip this check, except those of a FairPlay-only track that the FairPlay bridge licensed. When one of these fails, unshackle flags the pair, stops the track and keeps no output file. A file this FFmpeg build cannot judge counts as a pass, never as a wrong content key: a codec it has no decoder for, or a header it cannot read. A pass is not proof. A wrong content key for HEVC video can decode without an error for some seconds, most often at a low resolution, and that content key passes the check. Without FFmpeg there is no check at all.</p>
|
||||
<p>A public vault can return the right KID with a wrong content key. The decrypters accept a wrong content key and write noise. unshackle therefore trusts a content key from a vault only after FFmpeg decodes the decrypted track with strict error detection. For a fragmented MP4, unshackle reads from the encrypted file which fragments each KID encrypts, and FFmpeg decodes up to three windows of each KID: from its first, middle and last fragment on through the next fragments of that KID, for up to 4 seconds. A window never runs into a fragment of another KID or a clear fragment. A clear lead or a lead under another KID therefore cannot hide a wrong content key, and only the KID that fails is flagged. When every KID in the map has a content key, the map is complete, and a KID that is not in it does not encrypt this file. This file does not judge that KID; the file of its own track judges it. A file with no encrypted sample entry and no encrypted fragment, for example a clear audio track, judges no KID, so it neither flags nor copies a content key. A KID that is not in an incomplete map, for example one with an all-zero KID, and every KID of any other file, gets one check of the whole file. FFmpeg decodes the first seconds and the last seconds. A failure there flags each of those KIDs. When a mapped KID fails, the KIDs that are not in the map get no verdict from that pass; the retry with the replaced key judges them. Content keys from a licence skip this check, except those of a FairPlay-only track that the FairPlay bridge licensed. An import also checks these content keys when it reads them from an export file. When one of these fails, unshackle flags the pair, stops the track and keeps no output file. A file this FFmpeg build cannot judge counts as a pass, never as a wrong content key: a codec it has no decoder for, or a header it cannot read. A pass is not proof. A wrong content key for HEVC video can decode without an error for some seconds, most often at a low resolution, and that content key passes the check. Without FFmpeg there is no check at all.</p>
|
||||
<p>When the decode fails, unshackle:</p>
|
||||
<ol>
|
||||
<li>Flags the KID:KEY in the <code>bad_keys</code> table of every local SQLite vault, with the service and the name of the vault it came from. The pair also goes out of the service table, except in a vault marked <code>no_push</code>, where only the flag is written. A flagged pair cannot go back into a local vault from another vault, a later run, or <code>kv copy</code>. A licence that returns the pair clears the flag and stores it. An <code>API</code> vault that served the pair gets a report only when a different content key for that KID is accepted. When the CDM returns the same content key, that vault gets no report. <code>HTTP</code> and <code>MySQL</code> vaults have no report route. A pair from a local vault goes to no remote vault, even when a remote vault holds the same pair.</li>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user