mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-03 14:35:09 +00:00
Deployed 3b6bd02e with MkDocs version: 1.6.1
This commit is contained in:
@@ -3600,6 +3600,10 @@ and keeps the service's numbering unchanged. Pick an order that covers the whole
|
||||
<p class="admonition-title">Some flags cannot be combined</p>
|
||||
<p><code>--select-titles</code> and <code>--wanted</code> are mutually exclusive. <code>--vbitrate</code> and <code>--vbitrate-range</code> (and the audio equivalents) are mutually exclusive.</p>
|
||||
</div>
|
||||
<div class="admonition info">
|
||||
<p class="admonition-title">Exit codes</p>
|
||||
<p><code>dl</code> exits with code 1 when a track download or a mux fails, or when a missing track or language stops the run. A signal gives code 128 plus the signal number: 143 for SIGTERM. A run that ends without a failure, a <code>--list</code> run included, exits with code 0.</p>
|
||||
</div>
|
||||
<hr />
|
||||
<h2 id="search"><code>search</code><a class="headerlink" href="#search" title="Permanent link">¶</a></h2>
|
||||
<p>Find titles on a service. Like <code>dl</code>, <code>search</code> is a group whose subcommands are the installed services, and it reuses <code>dl</code>'s authentication, cookie, and proxy machinery.</p>
|
||||
@@ -3658,7 +3662,7 @@ and keeps the service's numbering unchanged. Pick an order that covers the whole
|
||||
<p>Reconstruct a download (download → decrypt → mux) from an <code>--export</code> JSON file without re-contacting the service. It uses the DASH or ISM manifest that the export saved, or fetches the manifest again when the export has none. It injects the stored keys and then runs the normal <code>dl</code> pipeline. The service tag is read from the export file, not passed by you.</p>
|
||||
<div class="language-text highlight"><pre><span></span><code><span id="__span-5-1"><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>unshackle import EXPORT_FILE [DL_ARGS...]
|
||||
</span></code></pre></div>
|
||||
<p>unshackle forwards any <code>dl</code> options after the file verbatim, so you can override quality, range, proxy, and so on.</p>
|
||||
<p>unshackle forwards any <code>dl</code> options after the file verbatim, so you can override quality, range, proxy, and so on. The import selects tracks with the <code>dl</code> defaults, not with the selection of the export. Give the selection options of the export again, for example <code>-r HYBRID</code> for an export of HDR tracks.</p>
|
||||
<div class="admonition example">
|
||||
<p class="admonition-title">Example</p>
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-6-1"><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a>unshackle<span class="w"> </span>import<span class="w"> </span>export.json
|
||||
|
||||
@@ -3704,7 +3704,8 @@ picks the bitrate. If you set neither, unshackle takes the best track.</p>
|
||||
<p class="admonition-title">Two FLAC tracks in one release</p>
|
||||
<p>A service can offer both a CD FLAC and a hi-res FLAC. The two have the same codec, so
|
||||
the bitrate is what separates them. Use <code>--list</code> to read the bitrates, then give <code>-ab</code>
|
||||
the one you want.</p>
|
||||
the one you want. When the service gives them, <code>--list</code> also shows the bit depth and
|
||||
sample rate, such as "24-bit / 96 kHz".</p>
|
||||
</div>
|
||||
<h2 id="languages">Languages<a class="headerlink" href="#languages" title="Permanent link">¶</a></h2>
|
||||
<h3 id="video-and-audio-language">Video and audio language<a class="headerlink" href="#video-and-audio-language" title="Permanent link">¶</a></h3>
|
||||
|
||||
@@ -2683,8 +2683,8 @@ license-server handshake. The rest are special cases.</p>
|
||||
<tr>
|
||||
<td><strong>MonaLisa</strong> (proprietary, WASM)</td>
|
||||
<td><code>.mld</code></td>
|
||||
<td>Ticket from the service API; keys extracted locally via WASM. No license server.</td>
|
||||
<td>External tool that the service names, per segment or on the whole track</td>
|
||||
<td>Ticket from the service API; keys extracted locally via WASM. No license server. Over <code>--remote</code> the server extracts the content key and sends it to the client, only when the remote session uses the server CDM.</td>
|
||||
<td>The tool that the service names, else <code>bbtsdecrypt</code> per segment, else the built-in decrypter per segment, which needs no tool. Over <code>--remote</code> the client decrypts with its own tool or the built-in decrypter. An export holds the KID and the content key, and an import decrypts like a <code>--remote</code> client. After the merge FFmpeg decode-checks the video track; a content key that does not decode stops the track.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Blowfish stripe</strong></td>
|
||||
|
||||
@@ -2745,6 +2745,11 @@
|
||||
<p><strong>Inspect:</strong> the licence server gave no content key for a key ID of the init segments, or gave a PlayReady or Widevine content key that is not the FairPlay one. unshackle flags a content key that does not decode. The next licence of that key ID clears the flag, so each run licenses and checks the key again. Operate unshackle with <code>-d</code> and read the <code>Key check on</code> debug line for the result of each window. See <a href="../drm-and-cdm/">DRM & CDM</a>.</p>
|
||||
</div>
|
||||
<div class="admonition example">
|
||||
<p class="admonition-title">A MonaLisa track stops after its decryption</p>
|
||||
<p><strong>Symptom:</strong> the download of a MonaLisa video track stops with <code>The MonaLisa content key of KID <kid> does not decrypt track <id></code>, and unshackle keeps no output file.</p>
|
||||
<p><strong>Inspect:</strong> FFmpeg could not decode the decrypted track, so the content key is wrong, or the platform changed its BBTS format and the decrypter no longer fits it. unshackle flags the pair in the local vaults and does not copy it to another vault. Run again with the other decrypter: hide <code>bbtsdecrypt</code> to use the built-in one, or install it. If both fail, the content key is wrong. See <a href="../drm-and-cdm/">DRM & CDM</a>.</p>
|
||||
</div>
|
||||
<div class="admonition example">
|
||||
<p class="admonition-title">A network request fails at the connection or TLS layer</p>
|
||||
<p><strong>Symptom:</strong> timeouts, connection resets, or handshake errors, and unshackle's own logs do not give the full cause.</p>
|
||||
<p><strong>Inspect:</strong> set <code>debug_requests: true</code> and operate unshackle with <code>-d</code> to show the underlying <code>urllib3</code> / <code>rnet</code> / <code>httpx</code> logs. In the JSON debug log, filter for <code>http_request</code> operations to see which request failed, with its status, attempt number and failure. If you use a proxy, also read <a href="../proxies-and-vpn/">Proxies & VPN</a>.</p>
|
||||
|
||||
@@ -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. 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>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, with two exceptions: a FairPlay-only track that the FairPlay bridge licensed, and a MonaLisa video track. A MonaLisa track is MPEG-TS, so it gets the check of the whole file after the merge of its decrypted segments. This applies to both decrypters. 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 BBTS decrypter keeps the continuity counter of a TS packet that it empties, so unshackle corrects the counters of a MonaLisa track before the check. 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. Damage to a small part of the slice data, such as one corrupt NAL unit, also often decodes without an error. 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>
|
||||
@@ -2412,7 +2412,7 @@
|
||||
<li>Removes the flag when the CDM returns the same content key, because then the decode check was wrong, not the content key. A content key from another vault is checked in its turn, and flagged as well if it also fails.</li>
|
||||
</ol>
|
||||
<p>The download stops with an error instead of writing noise when no ciphertext is left to retry with, or when every vault and the CDM are used up. Without a local SQLite vault nothing remembers a flag, so the same vault serves the same pair again and the download stops there.</p>
|
||||
<p>Per-segment decryption gives up the retry. With <code>decrypt_segments</code> on, and always with a MonaLisa tool that decrypts segments, the plaintext replaces each segment as it arrives, so no ciphertext is left. A failed decode then flags the pair and stops the download. The next run skips the flagged pair.</p>
|
||||
<p>Per-segment decryption gives up the retry. With <code>decrypt_segments</code> on, and always with a per-segment MonaLisa decrypter, the plaintext replaces each segment as it arrives, so no ciphertext is left. A failed decode then flags the pair and stops the download. The next run skips the flagged pair.</p>
|
||||
<p>unshackle copies a content key from one vault to the others only after this check passes, so a content key that fails the check does not spread. Without FFmpeg, a content key from a vault is not copied at all. To see or clear the flags, open the SQLite file and read or delete rows in <code>bad_keys</code>.</p>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">A good two-vault setup</p>
|
||||
|
||||
Reference in New Issue
Block a user