mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-27 11:25:08 +00:00
Compare commits
26
Commits
21da928859
..
docs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf662a16fa | ||
|
|
8ede94f88a | ||
|
|
3efcd59710 | ||
|
|
9cb51a4c1f | ||
|
|
d799e77606 | ||
|
|
4522cdd85e | ||
|
|
f990aa70ba | ||
|
|
aa138942f6 | ||
|
|
3f7a6a3a31 | ||
|
|
58134587bb | ||
|
|
1a782ac6f1 | ||
|
|
852ee9b294 | ||
|
|
a172c46d9e | ||
|
|
93a047d941 | ||
|
|
7d5947db8d | ||
|
|
07b788d25d | ||
|
|
8d06ed27d7 | ||
|
|
195e27bf31 | ||
|
|
0007fbbe48 | ||
|
|
7c17f274bf | ||
|
|
87cdc295e1 | ||
|
|
a0fc5832f9 | ||
|
|
5cdd11e13f | ||
|
|
4496eab53b | ||
|
|
21911bd28f | ||
|
|
91315d7f79 |
@@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="/assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
|
||||
+198
-156
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -1491,7 +1491,18 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="get_titles: required">
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#optional-availability-metadata" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
Optional availability metadata
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Optional availability metadata">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -2243,7 +2254,18 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="get_titles: required">
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#optional-availability-metadata" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
Optional availability metadata
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Optional availability metadata">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -2474,7 +2496,7 @@ Click <code>cli</code> entry point plus three abstract methods.</p>
|
||||
<tr>
|
||||
<td><code>NO_SUBTITLES</code></td>
|
||||
<td><code>bool</code></td>
|
||||
<td>Set <code>True</code> on a service with no subtitle tracks to skip subtitle handling entirely.</td>
|
||||
<td>Set <code>True</code> on a service with no subtitle tracks to skip subtitle handling entirely. Default <code>False</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>ANIME</code></td>
|
||||
@@ -2488,13 +2510,6 @@ Click <code>cli</code> entry point plus three abstract methods.</p>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title"><code>NO_SUBTITLES</code> is a convention, not a base-class attribute</p>
|
||||
<p><code>dl.py</code> uses <code>hasattr</code> to find <code>NO_SUBTITLES</code>, and the <code>Service</code> base class
|
||||
deliberately does <strong>not</strong> declare it, so it only exists if your service
|
||||
defines it. Setting <code>NO_SUBTITLES = True</code> is what makes the pipeline skip
|
||||
subtitle work for services that never carry subtitles. Leave it off otherwise.</p>
|
||||
</div>
|
||||
<p><code>GEOFENCE</code> drives an automatic proxy: on startup, if you did not pass an
|
||||
explicit <code>--proxy</code>, the base class does a live IP check and, if your region is
|
||||
blocked, fetches a proxy to <code>GEOFENCE[0]</code> from your configured proxy providers.</p>
|
||||
@@ -2676,6 +2691,19 @@ returns a value. <code>check</code> returns <code>None</code> while the approval
|
||||
when the client deletes the remote session, so the loop does not continue on the
|
||||
server with no client. The message goes out as a log line, so a remote
|
||||
session shows it. A REST download job shows it in its <code>notice</code> field until the wait ends.</p>
|
||||
<p>For a login that the user scans with a phone, give the text of the QR code as <code>qr</code>. Both
|
||||
<code>wait_for_approval</code> and <code>request_input</code> take it. The terminal that shows the message draws
|
||||
the code under it, on the client for a remote session. Give the text that the login API puts in
|
||||
the code, such as the login URL, not an image. Keep the URL or code in the message too: a
|
||||
terminal that cannot draw the code, or a phone that cannot read it, still shows the text.
|
||||
<code>EXAMPLE.scan_login</code> in <code>unshackle/services/EXAMPLE/</code> shows the whole flow.</p>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-8-1"><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a><span class="n">token</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">wait_for_approval</span><span class="p">(</span>
|
||||
</span><span id="__span-8-2"><a id="__codelineno-8-2" name="__codelineno-8-2" href="#__codelineno-8-2"></a> <span class="sa">f</span><span class="s2">"Scan the code with the app, or open </span><span class="si">{</span><span class="n">login_url</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span>
|
||||
</span><span id="__span-8-3"><a id="__codelineno-8-3" name="__codelineno-8-3" href="#__codelineno-8-3"></a> <span class="n">check</span><span class="o">=</span><span class="k">lambda</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">poll_login</span><span class="p">(</span><span class="n">session_id</span><span class="p">),</span>
|
||||
</span><span id="__span-8-4"><a id="__codelineno-8-4" name="__codelineno-8-4" href="#__codelineno-8-4"></a> <span class="n">timeout</span><span class="o">=</span><span class="n">expires_in</span><span class="p">,</span>
|
||||
</span><span id="__span-8-5"><a id="__codelineno-8-5" name="__codelineno-8-5" href="#__codelineno-8-5"></a> <span class="n">qr</span><span class="o">=</span><span class="n">login_url</span><span class="p">,</span>
|
||||
</span><span id="__span-8-6"><a id="__codelineno-8-6" name="__codelineno-8-6" href="#__codelineno-8-6"></a><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
<p>The wait sees a cancel only between two <code>check</code> calls, so <code>check</code> must return within a few
|
||||
seconds. A <code>check</code> that reads a socket keeps the socket open across calls and returns <code>None</code>
|
||||
after each short idle wait.</p>
|
||||
@@ -2724,38 +2752,49 @@ identity for you.</p>
|
||||
<p>Every title carries a <code>language</code> (its <strong>original recorded language</strong>) and an
|
||||
arbitrary <code>data</code> dict you can use to stash metadata for later methods. You must
|
||||
return at least one title. If you return none, unshackle treats the ID as invalid.</p>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-8-1"><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_titles</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Titles_T</span><span class="p">:</span>
|
||||
</span><span id="__span-8-2"><a id="__codelineno-8-2" name="__codelineno-8-2" href="#__codelineno-8-2"></a> <span class="n">match</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">TITLE_RE</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
|
||||
</span><span id="__span-8-3"><a id="__codelineno-8-3" name="__codelineno-8-3" href="#__codelineno-8-3"></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">match</span><span class="p">:</span>
|
||||
</span><span id="__span-8-4"><a id="__codelineno-8-4" name="__codelineno-8-4" href="#__codelineno-8-4"></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Could not parse a title ID - is the URL/ID correct?"</span><span class="p">)</span>
|
||||
</span><span id="__span-8-5"><a id="__codelineno-8-5" name="__codelineno-8-5" href="#__codelineno-8-5"></a> <span class="n">metadata</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">get</span><span class="p">(</span>
|
||||
</span><span id="__span-8-6"><a id="__codelineno-8-6" name="__codelineno-8-6" href="#__codelineno-8-6"></a> <span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"endpoints"</span><span class="p">][</span><span class="s2">"metadata"</span><span class="p">]</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">title_id</span><span class="o">=</span><span class="n">match</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="s2">"title_id"</span><span class="p">)),</span>
|
||||
</span><span id="__span-8-7"><a id="__codelineno-8-7" name="__codelineno-8-7" href="#__codelineno-8-7"></a> <span class="n">params</span><span class="o">=</span><span class="p">{</span><span class="s2">"token"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">token</span><span class="p">},</span>
|
||||
</span><span id="__span-8-8"><a id="__codelineno-8-8" name="__codelineno-8-8" href="#__codelineno-8-8"></a> <span class="p">)</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>
|
||||
</span><span id="__span-8-9"><a id="__codelineno-8-9" name="__codelineno-8-9" href="#__codelineno-8-9"></a> <span class="n">original_lang</span> <span class="o">=</span> <span class="n">Language</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="n">metadata</span><span class="p">[</span><span class="s2">"languages"</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span>
|
||||
</span><span id="__span-8-10"><a id="__codelineno-8-10" name="__codelineno-8-10" href="#__codelineno-8-10"></a>
|
||||
</span><span id="__span-8-11"><a id="__codelineno-8-11" name="__codelineno-8-11" href="#__codelineno-8-11"></a> <span class="k">return</span> <span class="n">Movies</span><span class="p">([</span>
|
||||
</span><span id="__span-8-12"><a id="__codelineno-8-12" name="__codelineno-8-12" href="#__codelineno-8-12"></a> <span class="n">Movie</span><span class="p">(</span>
|
||||
</span><span id="__span-8-13"><a id="__codelineno-8-13" name="__codelineno-8-13" href="#__codelineno-8-13"></a> <span class="n">id_</span><span class="o">=</span><span class="n">metadata</span><span class="p">[</span><span class="s2">"id"</span><span class="p">],</span>
|
||||
</span><span id="__span-8-14"><a id="__codelineno-8-14" name="__codelineno-8-14" href="#__codelineno-8-14"></a> <span class="n">service</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">,</span>
|
||||
</span><span id="__span-8-15"><a id="__codelineno-8-15" name="__codelineno-8-15" href="#__codelineno-8-15"></a> <span class="n">name</span><span class="o">=</span><span class="n">metadata</span><span class="p">[</span><span class="s2">"title"</span><span class="p">],</span>
|
||||
</span><span id="__span-8-16"><a id="__codelineno-8-16" name="__codelineno-8-16" href="#__codelineno-8-16"></a> <span class="n">year</span><span class="o">=</span><span class="n">metadata</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"releaseYear"</span><span class="p">)</span> <span class="ow">or</span> <span class="kc">None</span><span class="p">,</span>
|
||||
</span><span id="__span-8-17"><a id="__codelineno-8-17" name="__codelineno-8-17" href="#__codelineno-8-17"></a> <span class="n">language</span><span class="o">=</span><span class="n">original_lang</span><span class="p">,</span> <span class="c1"># ORIGINAL audio language, not the -l preference</span>
|
||||
</span><span id="__span-8-18"><a id="__codelineno-8-18" name="__codelineno-8-18" href="#__codelineno-8-18"></a> <span class="n">data</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span> <span class="c1"># read later as title.data</span>
|
||||
</span><span id="__span-8-19"><a id="__codelineno-8-19" name="__codelineno-8-19" href="#__codelineno-8-19"></a> <span class="p">)</span>
|
||||
</span><span id="__span-8-20"><a id="__codelineno-8-20" name="__codelineno-8-20" href="#__codelineno-8-20"></a> <span class="p">])</span>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-9-1"><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_titles</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Titles_T</span><span class="p">:</span>
|
||||
</span><span id="__span-9-2"><a id="__codelineno-9-2" name="__codelineno-9-2" href="#__codelineno-9-2"></a> <span class="n">match</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">TITLE_RE</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
|
||||
</span><span id="__span-9-3"><a id="__codelineno-9-3" name="__codelineno-9-3" href="#__codelineno-9-3"></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">match</span><span class="p">:</span>
|
||||
</span><span id="__span-9-4"><a id="__codelineno-9-4" name="__codelineno-9-4" href="#__codelineno-9-4"></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Could not parse a title ID - is the URL/ID correct?"</span><span class="p">)</span>
|
||||
</span><span id="__span-9-5"><a id="__codelineno-9-5" name="__codelineno-9-5" href="#__codelineno-9-5"></a> <span class="n">metadata</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">get</span><span class="p">(</span>
|
||||
</span><span id="__span-9-6"><a id="__codelineno-9-6" name="__codelineno-9-6" href="#__codelineno-9-6"></a> <span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"endpoints"</span><span class="p">][</span><span class="s2">"metadata"</span><span class="p">]</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">title_id</span><span class="o">=</span><span class="n">match</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="s2">"title_id"</span><span class="p">)),</span>
|
||||
</span><span id="__span-9-7"><a id="__codelineno-9-7" name="__codelineno-9-7" href="#__codelineno-9-7"></a> <span class="n">params</span><span class="o">=</span><span class="p">{</span><span class="s2">"token"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">token</span><span class="p">},</span>
|
||||
</span><span id="__span-9-8"><a id="__codelineno-9-8" name="__codelineno-9-8" href="#__codelineno-9-8"></a> <span class="p">)</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>
|
||||
</span><span id="__span-9-9"><a id="__codelineno-9-9" name="__codelineno-9-9" href="#__codelineno-9-9"></a> <span class="n">original_lang</span> <span class="o">=</span> <span class="n">Language</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="n">metadata</span><span class="p">[</span><span class="s2">"languages"</span><span class="p">][</span><span class="mi">0</span><span class="p">])</span>
|
||||
</span><span id="__span-9-10"><a id="__codelineno-9-10" name="__codelineno-9-10" href="#__codelineno-9-10"></a>
|
||||
</span><span id="__span-9-11"><a id="__codelineno-9-11" name="__codelineno-9-11" href="#__codelineno-9-11"></a> <span class="k">return</span> <span class="n">Movies</span><span class="p">([</span>
|
||||
</span><span id="__span-9-12"><a id="__codelineno-9-12" name="__codelineno-9-12" href="#__codelineno-9-12"></a> <span class="n">Movie</span><span class="p">(</span>
|
||||
</span><span id="__span-9-13"><a id="__codelineno-9-13" name="__codelineno-9-13" href="#__codelineno-9-13"></a> <span class="n">id_</span><span class="o">=</span><span class="n">metadata</span><span class="p">[</span><span class="s2">"id"</span><span class="p">],</span>
|
||||
</span><span id="__span-9-14"><a id="__codelineno-9-14" name="__codelineno-9-14" href="#__codelineno-9-14"></a> <span class="n">service</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">,</span>
|
||||
</span><span id="__span-9-15"><a id="__codelineno-9-15" name="__codelineno-9-15" href="#__codelineno-9-15"></a> <span class="n">name</span><span class="o">=</span><span class="n">metadata</span><span class="p">[</span><span class="s2">"title"</span><span class="p">],</span>
|
||||
</span><span id="__span-9-16"><a id="__codelineno-9-16" name="__codelineno-9-16" href="#__codelineno-9-16"></a> <span class="n">year</span><span class="o">=</span><span class="n">metadata</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"releaseYear"</span><span class="p">)</span> <span class="ow">or</span> <span class="kc">None</span><span class="p">,</span>
|
||||
</span><span id="__span-9-17"><a id="__codelineno-9-17" name="__codelineno-9-17" href="#__codelineno-9-17"></a> <span class="n">language</span><span class="o">=</span><span class="n">original_lang</span><span class="p">,</span> <span class="c1"># ORIGINAL audio language, not the -l preference</span>
|
||||
</span><span id="__span-9-18"><a id="__codelineno-9-18" name="__codelineno-9-18" href="#__codelineno-9-18"></a> <span class="n">data</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span> <span class="c1"># read later as title.data</span>
|
||||
</span><span id="__span-9-19"><a id="__codelineno-9-19" name="__codelineno-9-19" href="#__codelineno-9-19"></a> <span class="p">)</span>
|
||||
</span><span id="__span-9-20"><a id="__codelineno-9-20" name="__codelineno-9-20" href="#__codelineno-9-20"></a> <span class="p">])</span>
|
||||
</span></code></pre></div>
|
||||
<h3 id="optional-availability-metadata">Optional availability metadata<a class="headerlink" href="#optional-availability-metadata" title="Permanent link">¶</a></h3>
|
||||
<p>A service may set <code>title.data["availability"]</code> to a dict with two optional fields:</p>
|
||||
<ul>
|
||||
<li><code>paid</code>: a boolean describing the catalogue offer, not the account's entitlement.</li>
|
||||
<li><code>access</code>: <code>"granted"</code>, <code>"denied"</code>, or <code>"unknown"</code> for the authenticated account.
|
||||
Report <code>"denied"</code> only when the platform explicitly confirms lack of access.
|
||||
Missing or unverified access is not denial.</li>
|
||||
</ul>
|
||||
<p>Only these allowlisted fields reach the REST API as <code>availability</code>, including
|
||||
through remote title reconstruction. The CLI's <code>--list-titles</code> does not display
|
||||
them, and nothing in core reads them to select or authorize downloads.</p>
|
||||
<p>Common constructor fields:</p>
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="1:3"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><input id="__tabbed_1_3" name="__tabbed_1" type="radio" /><div class="tabbed-labels"><label for="__tabbed_1_1">Movie</label><label for="__tabbed_1_2">Episode</label><label for="__tabbed_1_3">Song</label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-9-1"><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a><span class="n">Movie</span><span class="p">(</span><span class="n">id_</span><span class="p">,</span> <span class="n">service</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">year</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">language</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-10-1"><a id="__codelineno-10-1" name="__codelineno-10-1" href="#__codelineno-10-1"></a><span class="n">Movie</span><span class="p">(</span><span class="n">id_</span><span class="p">,</span> <span class="n">service</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">year</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">language</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-10-1"><a id="__codelineno-10-1" name="__codelineno-10-1" href="#__codelineno-10-1"></a><span class="n">Episode</span><span class="p">(</span><span class="n">id_</span><span class="p">,</span> <span class="n">service</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">season</span><span class="p">,</span> <span class="n">number</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">year</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
</span><span id="__span-10-2"><a id="__codelineno-10-2" name="__codelineno-10-2" href="#__codelineno-10-2"></a> <span class="n">language</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">air_date</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
</span><span id="__span-10-3"><a id="__codelineno-10-3" name="__codelineno-10-3" href="#__codelineno-10-3"></a> <span class="n">part</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-11-1"><a id="__codelineno-11-1" name="__codelineno-11-1" href="#__codelineno-11-1"></a><span class="n">Episode</span><span class="p">(</span><span class="n">id_</span><span class="p">,</span> <span class="n">service</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">season</span><span class="p">,</span> <span class="n">number</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">year</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
</span><span id="__span-11-2"><a id="__codelineno-11-2" name="__codelineno-11-2" href="#__codelineno-11-2"></a> <span class="n">language</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">air_date</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
</span><span id="__span-11-3"><a id="__codelineno-11-3" name="__codelineno-11-3" href="#__codelineno-11-3"></a> <span class="n">part</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
<p>Pass <code>air_date</code> for daily and sports titles to name by date instead of
|
||||
<code>SxxExx</code>. Return a <code>Series([...])</code> of episodes. Pass <code>part</code> only when the
|
||||
@@ -2763,8 +2802,8 @@ service splits one episode into several videos, see
|
||||
<a href="#split-episodes">Split episodes</a>.</p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-11-1"><a id="__codelineno-11-1" name="__codelineno-11-1" href="#__codelineno-11-1"></a><span class="n">Song</span><span class="p">(</span><span class="n">id_</span><span class="p">,</span> <span class="n">service</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">artist</span><span class="p">,</span> <span class="n">album</span><span class="p">,</span> <span class="n">track</span><span class="p">,</span> <span class="n">disc</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">year</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
</span><span id="__span-11-2"><a id="__codelineno-11-2" name="__codelineno-11-2" href="#__codelineno-11-2"></a> <span class="n">language</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">...</span><span class="p">)</span>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-12-1"><a id="__codelineno-12-1" name="__codelineno-12-1" href="#__codelineno-12-1"></a><span class="n">Song</span><span class="p">(</span><span class="n">id_</span><span class="p">,</span> <span class="n">service</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">artist</span><span class="p">,</span> <span class="n">album</span><span class="p">,</span> <span class="n">track</span><span class="p">,</span> <span class="n">disc</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">year</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
</span><span id="__span-12-2"><a id="__codelineno-12-2" name="__codelineno-12-2" href="#__codelineno-12-2"></a> <span class="n">language</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">...</span><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
<p>Return an <code>Album([...])</code> of songs. <code>disc</code> defaults to 1 and <code>year</code> is optional.
|
||||
Optional metadata keywords such as <code>album_artist</code>, <code>genre</code>, <code>isrc</code>, <code>label</code>,
|
||||
@@ -2772,9 +2811,9 @@ Optional metadata keywords such as <code>album_artist</code>, <code>genre</code>
|
||||
class for the current list.</p>
|
||||
<p>From <code>get_tracks()</code>, give one <code>Audio</code> track for each codec and bitrate you offer
|
||||
for the song. The framework then selects one with its usual audio options.
|
||||
A <code>Song</code> skips the muxer, so restore the real container suffix on the track path
|
||||
in <code>on_track_downloaded</code>. The <strong>MUSIC_EXAMPLE</strong> service shows the full music
|
||||
surface.</p>
|
||||
A <code>Song</code> skips the muxer: the framework reads the codec from the downloaded file
|
||||
and gives the file its container, so a service does not rename the track path.
|
||||
The <strong>MUSIC_EXAMPLE</strong> service shows the full music surface.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2793,8 +2832,8 @@ when the API errors. It also applies the per-service <code>title_map</code> conf
|
||||
<p>Some services split one logical episode into several separately playable videos, for
|
||||
example a variety show that ships episode 1 as <em>Episode 1 (Part 1)</em>, <em>(Part 2)</em> and
|
||||
<em>(Part 3)</em>. <code>Episode.number</code> stays an <code>int</code>. The optional <code>part</code> carries the index.</p>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-12-1"><a id="__codelineno-12-1" name="__codelineno-12-1" href="#__codelineno-12-1"></a><span class="n">Episode</span><span class="p">(</span><span class="o">...</span><span class="p">,</span> <span class="n">season</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">number</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">part</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s2">"The Reckoning"</span><span class="p">)</span>
|
||||
</span><span id="__span-12-2"><a id="__codelineno-12-2" name="__codelineno-12-2" href="#__codelineno-12-2"></a><span class="n">Episode</span><span class="p">(</span><span class="o">...</span><span class="p">,</span> <span class="n">season</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">number</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">part</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s2">"The Reckoning"</span><span class="p">)</span>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-13-1"><a id="__codelineno-13-1" name="__codelineno-13-1" href="#__codelineno-13-1"></a><span class="n">Episode</span><span class="p">(</span><span class="o">...</span><span class="p">,</span> <span class="n">season</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">number</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">part</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s2">"The Reckoning"</span><span class="p">)</span>
|
||||
</span><span id="__span-13-2"><a id="__codelineno-13-2" name="__codelineno-13-2" href="#__codelineno-13-2"></a><span class="n">Episode</span><span class="p">(</span><span class="o">...</span><span class="p">,</span> <span class="n">season</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">number</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">part</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s2">"The Reckoning"</span><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
<ol>
|
||||
<li><code>part</code> counts from 1, contiguous. unshackle rejects <code>part=0</code>, and <code>-w</code> can only
|
||||
@@ -2838,29 +2877,29 @@ has nothing to adopt.</p>
|
||||
<code>Subtitle</code> tracks. In almost all cases you assemble these by parsing a manifest,
|
||||
not by hand.</p>
|
||||
<p>The manifest parsers live in <code>unshackle.core.manifests</code>:</p>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-13-1"><a id="__codelineno-13-1" name="__codelineno-13-1" href="#__codelineno-13-1"></a><span class="kn">from</span><span class="w"> </span><span class="nn">unshackle.core.manifests</span><span class="w"> </span><span class="kn">import</span> <span class="n">DASH</span><span class="p">,</span> <span class="n">HLS</span><span class="p">,</span> <span class="n">ISM</span>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-14-1"><a id="__codelineno-14-1" name="__codelineno-14-1" href="#__codelineno-14-1"></a><span class="kn">from</span><span class="w"> </span><span class="nn">unshackle.core.manifests</span><span class="w"> </span><span class="kn">import</span> <span class="n">DASH</span><span class="p">,</span> <span class="n">HLS</span><span class="p">,</span> <span class="n">ISM</span>
|
||||
</span></code></pre></div>
|
||||
<p>Each exposes <code>from_url(url, session=...)</code> (or <code>from_text(text, url)</code>) and then
|
||||
<code>.to_tracks(language=...)</code>:</p>
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="2:3"><input checked="checked" id="__tabbed_2_1" name="__tabbed_2" type="radio" /><input id="__tabbed_2_2" name="__tabbed_2" type="radio" /><input id="__tabbed_2_3" name="__tabbed_2" type="radio" /><div class="tabbed-labels"><label for="__tabbed_2_1">DASH (.mpd)</label><label for="__tabbed_2_2">HLS (.m3u8)</label><label for="__tabbed_2_3">ISM (Smooth Streaming)</label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-14-1"><a id="__codelineno-14-1" name="__codelineno-14-1" href="#__codelineno-14-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_tracks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Tracks</span><span class="p">:</span>
|
||||
</span><span id="__span-14-2"><a id="__codelineno-14-2" name="__codelineno-14-2" href="#__codelineno-14-2"></a> <span class="k">return</span> <span class="n">DASH</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span><span class="n">manifest_url</span><span class="p">,</span> <span class="n">session</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">session</span><span class="p">)</span> \
|
||||
</span><span id="__span-14-3"><a id="__codelineno-14-3" name="__codelineno-14-3" href="#__codelineno-14-3"></a> <span class="o">.</span><span class="n">to_tracks</span><span class="p">(</span><span class="n">language</span><span class="o">=</span><span class="n">title</span><span class="o">.</span><span class="n">language</span><span class="p">)</span>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-15-1"><a id="__codelineno-15-1" name="__codelineno-15-1" href="#__codelineno-15-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_tracks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Tracks</span><span class="p">:</span>
|
||||
</span><span id="__span-15-2"><a id="__codelineno-15-2" name="__codelineno-15-2" href="#__codelineno-15-2"></a> <span class="k">return</span> <span class="n">DASH</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span><span class="n">manifest_url</span><span class="p">,</span> <span class="n">session</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">session</span><span class="p">)</span> \
|
||||
</span><span id="__span-15-3"><a id="__codelineno-15-3" name="__codelineno-15-3" href="#__codelineno-15-3"></a> <span class="o">.</span><span class="n">to_tracks</span><span class="p">(</span><span class="n">language</span><span class="o">=</span><span class="n">title</span><span class="o">.</span><span class="n">language</span><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-15-1"><a id="__codelineno-15-1" name="__codelineno-15-1" href="#__codelineno-15-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_tracks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Tracks</span><span class="p">:</span>
|
||||
</span><span id="__span-15-2"><a id="__codelineno-15-2" name="__codelineno-15-2" href="#__codelineno-15-2"></a> <span class="k">return</span> <span class="n">HLS</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span><span class="n">manifest_url</span><span class="p">,</span> <span class="n">session</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">session</span><span class="p">)</span> \
|
||||
</span><span id="__span-15-3"><a id="__codelineno-15-3" name="__codelineno-15-3" href="#__codelineno-15-3"></a> <span class="o">.</span><span class="n">to_tracks</span><span class="p">(</span><span class="n">language</span><span class="o">=</span><span class="n">title</span><span class="o">.</span><span class="n">language</span><span class="p">)</span>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-16-1"><a id="__codelineno-16-1" name="__codelineno-16-1" href="#__codelineno-16-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_tracks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Tracks</span><span class="p">:</span>
|
||||
</span><span id="__span-16-2"><a id="__codelineno-16-2" name="__codelineno-16-2" href="#__codelineno-16-2"></a> <span class="k">return</span> <span class="n">HLS</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span><span class="n">manifest_url</span><span class="p">,</span> <span class="n">session</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">session</span><span class="p">)</span> \
|
||||
</span><span id="__span-16-3"><a id="__codelineno-16-3" name="__codelineno-16-3" href="#__codelineno-16-3"></a> <span class="o">.</span><span class="n">to_tracks</span><span class="p">(</span><span class="n">language</span><span class="o">=</span><span class="n">title</span><span class="o">.</span><span class="n">language</span><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
<p>The URL must be a <strong>variant (master) playlist</strong>, not a media playlist.</p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-16-1"><a id="__codelineno-16-1" name="__codelineno-16-1" href="#__codelineno-16-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_tracks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Tracks</span><span class="p">:</span>
|
||||
</span><span id="__span-16-2"><a id="__codelineno-16-2" name="__codelineno-16-2" href="#__codelineno-16-2"></a> <span class="k">return</span> <span class="n">ISM</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span><span class="n">manifest_url</span><span class="p">,</span> <span class="n">session</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">session</span><span class="p">)</span> \
|
||||
</span><span id="__span-16-3"><a id="__codelineno-16-3" name="__codelineno-16-3" href="#__codelineno-16-3"></a> <span class="o">.</span><span class="n">to_tracks</span><span class="p">(</span><span class="n">language</span><span class="o">=</span><span class="n">title</span><span class="o">.</span><span class="n">language</span><span class="p">)</span>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-17-1"><a id="__codelineno-17-1" name="__codelineno-17-1" href="#__codelineno-17-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_tracks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Tracks</span><span class="p">:</span>
|
||||
</span><span id="__span-17-2"><a id="__codelineno-17-2" name="__codelineno-17-2" href="#__codelineno-17-2"></a> <span class="k">return</span> <span class="n">ISM</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span><span class="n">manifest_url</span><span class="p">,</span> <span class="n">session</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">session</span><span class="p">)</span> \
|
||||
</span><span id="__span-17-3"><a id="__codelineno-17-3" name="__codelineno-17-3" href="#__codelineno-17-3"></a> <span class="o">.</span><span class="n">to_tracks</span><span class="p">(</span><span class="n">language</span><span class="o">=</span><span class="n">title</span><span class="o">.</span><span class="n">language</span><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2878,11 +2917,11 @@ language token.</p>
|
||||
provides <code>get_tracks_for_variants(title, fetch_fn)</code> to fan out over every
|
||||
codec×range in the <code>TrackRequest</code>, including <code>HYBRID</code> (fetch HDR10 + DV and
|
||||
merge) and <code>--best-available</code> skip-on-error handling:</p>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-17-1"><a id="__codelineno-17-1" name="__codelineno-17-1" href="#__codelineno-17-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_tracks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Tracks</span><span class="p">:</span>
|
||||
</span><span id="__span-17-2"><a id="__codelineno-17-2" name="__codelineno-17-2" href="#__codelineno-17-2"></a> <span class="k">def</span><span class="w"> </span><span class="nf">fetch_variant</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="n">codec</span><span class="p">,</span> <span class="n">range_</span><span class="p">)</span> <span class="o">-></span> <span class="n">Tracks</span><span class="p">:</span>
|
||||
</span><span id="__span-17-3"><a id="__codelineno-17-3" name="__codelineno-17-3" href="#__codelineno-17-3"></a> <span class="n">vcodec</span> <span class="o">=</span> <span class="s2">"H265"</span> <span class="k">if</span> <span class="n">codec</span> <span class="o">==</span> <span class="n">Video</span><span class="o">.</span><span class="n">Codec</span><span class="o">.</span><span class="n">HEVC</span> <span class="k">else</span> <span class="s2">"H264"</span>
|
||||
</span><span id="__span-17-4"><a id="__codelineno-17-4" name="__codelineno-17-4" href="#__codelineno-17-4"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">fetch_dash_manifest</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="n">vcodec</span><span class="o">=</span><span class="n">vcodec</span><span class="p">,</span> <span class="n">range_</span><span class="o">=</span><span class="n">range_</span><span class="p">)</span>
|
||||
</span><span id="__span-17-5"><a id="__codelineno-17-5" name="__codelineno-17-5" href="#__codelineno-17-5"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_tracks_for_variants</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="n">fetch_variant</span><span class="p">)</span>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-18-1"><a id="__codelineno-18-1" name="__codelineno-18-1" href="#__codelineno-18-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_tracks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Tracks</span><span class="p">:</span>
|
||||
</span><span id="__span-18-2"><a id="__codelineno-18-2" name="__codelineno-18-2" href="#__codelineno-18-2"></a> <span class="k">def</span><span class="w"> </span><span class="nf">fetch_variant</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="n">codec</span><span class="p">,</span> <span class="n">range_</span><span class="p">)</span> <span class="o">-></span> <span class="n">Tracks</span><span class="p">:</span>
|
||||
</span><span id="__span-18-3"><a id="__codelineno-18-3" name="__codelineno-18-3" href="#__codelineno-18-3"></a> <span class="n">vcodec</span> <span class="o">=</span> <span class="s2">"H265"</span> <span class="k">if</span> <span class="n">codec</span> <span class="o">==</span> <span class="n">Video</span><span class="o">.</span><span class="n">Codec</span><span class="o">.</span><span class="n">HEVC</span> <span class="k">else</span> <span class="s2">"H264"</span>
|
||||
</span><span id="__span-18-4"><a id="__codelineno-18-4" name="__codelineno-18-4" href="#__codelineno-18-4"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">fetch_dash_manifest</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="n">vcodec</span><span class="o">=</span><span class="n">vcodec</span><span class="p">,</span> <span class="n">range_</span><span class="o">=</span><span class="n">range_</span><span class="p">)</span>
|
||||
</span><span id="__span-18-5"><a id="__codelineno-18-5" name="__codelineno-18-5" href="#__codelineno-18-5"></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_tracks_for_variants</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="n">fetch_variant</span><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">What the helper merges</p>
|
||||
@@ -2942,9 +2981,12 @@ sure encrypted tracks carry the correct <code>drm</code> so the core licenses th
|
||||
<p>Return a <code>Chapters</code> object of 0 or more <code>Chapter</code>s. It sorts by timestamp,
|
||||
numbers the chapters at mux time, and adds a <code>00:00:00.000</code> chapter if none
|
||||
exists. Timestamps take <code>"HH:MM:SS[.mmm]"</code>, int milliseconds, or float seconds.</p>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-18-1"><a id="__codelineno-18-1" name="__codelineno-18-1" href="#__codelineno-18-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_chapters</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Chapters</span><span class="p">:</span>
|
||||
</span><span id="__span-18-2"><a id="__codelineno-18-2" name="__codelineno-18-2" href="#__codelineno-18-2"></a> <span class="n">chapters</span> <span class="o">=</span> <span class="p">[</span><span class="n">Chapter</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">c</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"name"</span><span class="p">),</span> <span class="n">timestamp</span><span class="o">=</span><span class="n">c</span><span class="p">[</span><span class="s2">"start"</span><span class="p">])</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">title</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"chapters"</span><span class="p">,</span> <span class="p">[])]</span>
|
||||
</span><span id="__span-18-3"><a id="__codelineno-18-3" name="__codelineno-18-3" href="#__codelineno-18-3"></a> <span class="k">return</span> <span class="n">Chapters</span><span class="p">(</span><span class="nb">sorted</span><span class="p">(</span><span class="n">chapters</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">c</span><span class="p">:</span> <span class="n">c</span><span class="o">.</span><span class="n">timestamp</span><span class="p">))</span>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-19-1"><a id="__codelineno-19-1" name="__codelineno-19-1" href="#__codelineno-19-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">get_chapters</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Chapters</span><span class="p">:</span>
|
||||
</span><span id="__span-19-2"><a id="__codelineno-19-2" name="__codelineno-19-2" href="#__codelineno-19-2"></a> <span class="n">chapters</span> <span class="o">=</span> <span class="p">[</span><span class="n">Chapter</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">c</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"name"</span><span class="p">),</span> <span class="n">timestamp</span><span class="o">=</span><span class="n">c</span><span class="p">[</span><span class="s2">"start"</span><span class="p">])</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">title</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"chapters"</span><span class="p">,</span> <span class="p">[])]</span>
|
||||
</span><span id="__span-19-3"><a id="__codelineno-19-3" name="__codelineno-19-3" href="#__codelineno-19-3"></a> <span class="n">unique</span><span class="p">:</span> <span class="nb">dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Chapter</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span>
|
||||
</span><span id="__span-19-4"><a id="__codelineno-19-4" name="__codelineno-19-4" href="#__codelineno-19-4"></a> <span class="k">for</span> <span class="n">chapter</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">chapters</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">c</span><span class="p">:</span> <span class="ow">not</span> <span class="n">c</span><span class="o">.</span><span class="n">named</span><span class="p">):</span>
|
||||
</span><span id="__span-19-5"><a id="__codelineno-19-5" name="__codelineno-19-5" href="#__codelineno-19-5"></a> <span class="n">unique</span><span class="o">.</span><span class="n">setdefault</span><span class="p">(</span><span class="n">chapter</span><span class="o">.</span><span class="n">timestamp</span><span class="p">,</span> <span class="n">chapter</span><span class="p">)</span>
|
||||
</span><span id="__span-19-6"><a id="__codelineno-19-6" name="__codelineno-19-6" href="#__codelineno-19-6"></a> <span class="k">return</span> <span class="n">Chapters</span><span class="p">(</span><span class="nb">sorted</span><span class="p">(</span><span class="n">unique</span><span class="o">.</span><span class="n">values</span><span class="p">(),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">c</span><span class="p">:</span> <span class="n">c</span><span class="o">.</span><span class="n">timestamp</span><span class="p">))</span>
|
||||
</span></code></pre></div>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Sort by timestamp before you build the <code>Chapters</code></p>
|
||||
@@ -2952,7 +2994,7 @@ exists. Timestamps take <code>"HH:MM:SS[.mmm]"</code>, int milliseconds, or floa
|
||||
not at <code>0</code>, and a duplicate timestamp raises <code>ValueError</code>. Sort first, so yours
|
||||
lands before it.</p>
|
||||
<p>You never need to add <code>Chapter(0)</code>. An API chapter at <code>0</code> keeps its name. Drop
|
||||
duplicate timestamps.</p>
|
||||
duplicate timestamps and keep the named chapter, as the example does.</p>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Close a named range with an unnamed chapter</p>
|
||||
@@ -3003,17 +3045,17 @@ current <code>title</code> and <code>track</code>:</p>
|
||||
</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>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-19-1"><a id="__codelineno-19-1" name="__codelineno-19-1" href="#__codelineno-19-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-19-2"><a id="__codelineno-19-2" name="__codelineno-19-2" href="#__codelineno-19-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-19-3"><a id="__codelineno-19-3" name="__codelineno-19-3" href="#__codelineno-19-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>
|
||||
</span><span id="__span-19-4"><a id="__codelineno-19-4" name="__codelineno-19-4" href="#__codelineno-19-4"></a> <span class="n">data</span><span class="o">=</span><span class="n">challenge</span><span class="p">,</span> <span class="c1"># POST the challenge as-is</span>
|
||||
</span><span id="__span-19-5"><a id="__codelineno-19-5" name="__codelineno-19-5" href="#__codelineno-19-5"></a> <span class="n">headers</span><span class="o">=</span><span class="p">{</span><span class="s2">"dt-custom-data"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">license_data</span><span class="p">[</span><span class="s2">"data"</span><span class="p">]},</span>
|
||||
</span><span id="__span-19-6"><a id="__codelineno-19-6" name="__codelineno-19-6" href="#__codelineno-19-6"></a> <span class="p">)</span>
|
||||
</span><span id="__span-19-7"><a id="__codelineno-19-7" name="__codelineno-19-7" href="#__codelineno-19-7"></a> <span class="n">response</span><span class="o">.</span><span class="n">raise_for_status</span><span class="p">()</span>
|
||||
</span><span id="__span-19-8"><a id="__codelineno-19-8" name="__codelineno-19-8" href="#__codelineno-19-8"></a> <span class="k">try</span><span class="p">:</span>
|
||||
</span><span id="__span-19-9"><a id="__codelineno-19-9" name="__codelineno-19-9" href="#__codelineno-19-9"></a> <span class="k">return</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()[</span><span class="s2">"license"</span><span class="p">]</span> <span class="c1"># some services wrap it in JSON</span>
|
||||
</span><span id="__span-19-10"><a id="__codelineno-19-10" name="__codelineno-19-10" href="#__codelineno-19-10"></a> <span class="k">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">KeyError</span><span class="p">):</span>
|
||||
</span><span id="__span-19-11"><a id="__codelineno-19-11" name="__codelineno-19-11" href="#__codelineno-19-11"></a> <span class="k">return</span> <span class="n">response</span><span class="o">.</span><span class="n">content</span> <span class="c1"># others return raw bytes</span>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-20-1"><a id="__codelineno-20-1" name="__codelineno-20-1" href="#__codelineno-20-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-20-2"><a id="__codelineno-20-2" name="__codelineno-20-2" href="#__codelineno-20-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-20-3"><a id="__codelineno-20-3" name="__codelineno-20-3" href="#__codelineno-20-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>
|
||||
</span><span id="__span-20-4"><a id="__codelineno-20-4" name="__codelineno-20-4" href="#__codelineno-20-4"></a> <span class="n">data</span><span class="o">=</span><span class="n">challenge</span><span class="p">,</span> <span class="c1"># POST the challenge as-is</span>
|
||||
</span><span id="__span-20-5"><a id="__codelineno-20-5" name="__codelineno-20-5" href="#__codelineno-20-5"></a> <span class="n">headers</span><span class="o">=</span><span class="p">{</span><span class="s2">"dt-custom-data"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">license_data</span><span class="p">[</span><span class="s2">"data"</span><span class="p">]},</span>
|
||||
</span><span id="__span-20-6"><a id="__codelineno-20-6" name="__codelineno-20-6" href="#__codelineno-20-6"></a> <span class="p">)</span>
|
||||
</span><span id="__span-20-7"><a id="__codelineno-20-7" name="__codelineno-20-7" href="#__codelineno-20-7"></a> <span class="n">response</span><span class="o">.</span><span class="n">raise_for_status</span><span class="p">()</span>
|
||||
</span><span id="__span-20-8"><a id="__codelineno-20-8" name="__codelineno-20-8" href="#__codelineno-20-8"></a> <span class="k">try</span><span class="p">:</span>
|
||||
</span><span id="__span-20-9"><a id="__codelineno-20-9" name="__codelineno-20-9" href="#__codelineno-20-9"></a> <span class="k">return</span> <span class="n">response</span><span class="o">.</span><span class="n">json</span><span class="p">()[</span><span class="s2">"license"</span><span class="p">]</span> <span class="c1"># some services wrap it in JSON</span>
|
||||
</span><span id="__span-20-10"><a id="__codelineno-20-10" name="__codelineno-20-10" href="#__codelineno-20-10"></a> <span class="k">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">KeyError</span><span class="p">):</span>
|
||||
</span><span id="__span-20-11"><a id="__codelineno-20-11" name="__codelineno-20-11" href="#__codelineno-20-11"></a> <span class="k">return</span> <span class="n">response</span><span class="o">.</span><span class="n">content</span> <span class="c1"># others return raw bytes</span>
|
||||
</span></code></pre></div>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Return the license untouched</p>
|
||||
@@ -3060,99 +3102,99 @@ flagged, banned, or downgraded.</p>
|
||||
account, and when <code>search()</code> does its own setup. A <code>search()</code> that reads a token, a header
|
||||
or a region from <code>authenticate()</code> fails or gives results for the wrong region.</p>
|
||||
</div>
|
||||
<div class="language-python highlight"><pre><span></span><code><span id="__span-20-1"><a id="__codelineno-20-1" name="__codelineno-20-1" href="#__codelineno-20-1"></a><span class="k">def</span><span class="w"> </span><span class="nf">search</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Generator</span><span class="p">[</span><span class="n">SearchResult</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">]:</span>
|
||||
</span><span id="__span-20-2"><a id="__codelineno-20-2" name="__codelineno-20-2" href="#__codelineno-20-2"></a> <span class="n">results</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">get</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"endpoints"</span><span class="p">][</span><span class="s2">"search"</span><span class="p">],</span>
|
||||
</span><span id="__span-20-3"><a id="__codelineno-20-3" name="__codelineno-20-3" href="#__codelineno-20-3"></a> <span class="n">params</span><span class="o">=</span><span class="p">{</span><span class="s2">"q"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">})</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>
|
||||
</span><span id="__span-20-4"><a id="__codelineno-20-4" name="__codelineno-20-4" href="#__codelineno-20-4"></a> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">results</span><span class="p">[</span><span class="s2">"entries"</span><span class="p">]:</span>
|
||||
</span><span id="__span-20-5"><a id="__codelineno-20-5" name="__codelineno-20-5" href="#__codelineno-20-5"></a> <span class="k">yield</span> <span class="n">SearchResult</span><span class="p">(</span><span class="n">id_</span><span class="o">=</span><span class="n">r</span><span class="p">[</span><span class="s2">"id"</span><span class="p">],</span> <span class="n">title</span><span class="o">=</span><span class="n">r</span><span class="p">[</span><span class="s2">"title"</span><span class="p">],</span>
|
||||
</span><span id="__span-20-6"><a id="__codelineno-20-6" name="__codelineno-20-6" href="#__codelineno-20-6"></a> <span class="n">description</span><span class="o">=</span><span class="n">r</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"description"</span><span class="p">),</span> <span class="n">url</span><span class="o">=</span><span class="n">r</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"url"</span><span class="p">))</span>
|
||||
<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">search</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Generator</span><span class="p">[</span><span class="n">SearchResult</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</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">results</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">get</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"endpoints"</span><span class="p">][</span><span class="s2">"search"</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="n">params</span><span class="o">=</span><span class="p">{</span><span class="s2">"q"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">})</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>
|
||||
</span><span id="__span-21-4"><a id="__codelineno-21-4" name="__codelineno-21-4" href="#__codelineno-21-4"></a> <span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="n">results</span><span class="p">[</span><span class="s2">"entries"</span><span class="p">]:</span>
|
||||
</span><span id="__span-21-5"><a id="__codelineno-21-5" name="__codelineno-21-5" href="#__codelineno-21-5"></a> <span class="k">yield</span> <span class="n">SearchResult</span><span class="p">(</span><span class="n">id_</span><span class="o">=</span><span class="n">r</span><span class="p">[</span><span class="s2">"id"</span><span class="p">],</span> <span class="n">title</span><span class="o">=</span><span class="n">r</span><span class="p">[</span><span class="s2">"title"</span><span class="p">],</span>
|
||||
</span><span id="__span-21-6"><a id="__codelineno-21-6" name="__codelineno-21-6" href="#__codelineno-21-6"></a> <span class="n">description</span><span class="o">=</span><span class="n">r</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"description"</span><span class="p">),</span> <span class="n">url</span><span class="o">=</span><span class="n">r</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"url"</span><span class="p">))</span>
|
||||
</span></code></pre></div>
|
||||
<hr />
|
||||
<h2 id="minimal-service-skeleton">Minimal service skeleton<a class="headerlink" href="#minimal-service-skeleton" title="Permanent link">¶</a></h2>
|
||||
<p>A complete, minimal single-manifest service. Save as
|
||||
<code>services/MYSVC/__init__.py</code> (class name <code>MYSVC</code>), with an optional
|
||||
<code>services/MYSVC/config.yaml</code> beside it.</p>
|
||||
<div class="language-python highlight"><span class="filename">services/MYSVC/__init__.py</span><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="kn">from</span><span class="w"> </span><span class="nn">__future__</span><span class="w"> </span><span class="kn">import</span> <span class="n">annotations</span>
|
||||
</span><span id="__span-21-2"><a id="__codelineno-21-2" name="__codelineno-21-2" href="#__codelineno-21-2"></a>
|
||||
</span><span id="__span-21-3"><a id="__codelineno-21-3" name="__codelineno-21-3" href="#__codelineno-21-3"></a><span class="kn">import</span><span class="w"> </span><span class="nn">re</span>
|
||||
</span><span id="__span-21-4"><a id="__codelineno-21-4" name="__codelineno-21-4" href="#__codelineno-21-4"></a><span class="kn">from</span><span class="w"> </span><span class="nn">typing</span><span class="w"> </span><span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Optional</span>
|
||||
</span><span id="__span-21-5"><a id="__codelineno-21-5" name="__codelineno-21-5" href="#__codelineno-21-5"></a>
|
||||
</span><span id="__span-21-6"><a id="__codelineno-21-6" name="__codelineno-21-6" href="#__codelineno-21-6"></a><span class="kn">import</span><span class="w"> </span><span class="nn">click</span>
|
||||
</span><span id="__span-21-7"><a id="__codelineno-21-7" name="__codelineno-21-7" href="#__codelineno-21-7"></a>
|
||||
</span><span id="__span-21-8"><a id="__codelineno-21-8" name="__codelineno-21-8" href="#__codelineno-21-8"></a><span class="kn">from</span><span class="w"> </span><span class="nn">unshackle.core.manifests</span><span class="w"> </span><span class="kn">import</span> <span class="n">DASH</span>
|
||||
</span><span id="__span-21-9"><a id="__codelineno-21-9" name="__codelineno-21-9" href="#__codelineno-21-9"></a><span class="kn">from</span><span class="w"> </span><span class="nn">unshackle.core.service</span><span class="w"> </span><span class="kn">import</span> <span class="n">Service</span>
|
||||
</span><span id="__span-21-10"><a id="__codelineno-21-10" name="__codelineno-21-10" href="#__codelineno-21-10"></a><span class="kn">from</span><span class="w"> </span><span class="nn">unshackle.core.titles</span><span class="w"> </span><span class="kn">import</span> <span class="n">Movie</span><span class="p">,</span> <span class="n">Movies</span><span class="p">,</span> <span class="n">Title_T</span><span class="p">,</span> <span class="n">Titles_T</span>
|
||||
</span><span id="__span-21-11"><a id="__codelineno-21-11" name="__codelineno-21-11" href="#__codelineno-21-11"></a><span class="kn">from</span><span class="w"> </span><span class="nn">unshackle.core.tracks</span><span class="w"> </span><span class="kn">import</span> <span class="n">Chapters</span><span class="p">,</span> <span class="n">Tracks</span>
|
||||
</span><span id="__span-21-12"><a id="__codelineno-21-12" name="__codelineno-21-12" href="#__codelineno-21-12"></a>
|
||||
</span><span id="__span-21-13"><a id="__codelineno-21-13" name="__codelineno-21-13" href="#__codelineno-21-13"></a>
|
||||
</span><span id="__span-21-14"><a id="__codelineno-21-14" name="__codelineno-21-14" href="#__codelineno-21-14"></a><span class="k">class</span><span class="w"> </span><span class="nc">MYSVC</span><span class="p">(</span><span class="n">Service</span><span class="p">):</span>
|
||||
</span><span id="__span-21-15"><a id="__codelineno-21-15" name="__codelineno-21-15" href="#__codelineno-21-15"></a><span class="w"> </span><span class="sd">"""</span>
|
||||
</span><span id="__span-21-16"><a id="__codelineno-21-16" name="__codelineno-21-16" href="#__codelineno-21-16"></a><span class="sd"> MyService - https://myservice.com</span>
|
||||
</span><span id="__span-21-17"><a id="__codelineno-21-17" name="__codelineno-21-17" href="#__codelineno-21-17"></a>
|
||||
</span><span id="__span-21-18"><a id="__codelineno-21-18" name="__codelineno-21-18" href="#__codelineno-21-18"></a><span class="sd"> \b</span>
|
||||
</span><span id="__span-21-19"><a id="__codelineno-21-19" name="__codelineno-21-19" href="#__codelineno-21-19"></a><span class="sd"> Usage: unshackle dl MYSVC <title-id-or-url></span>
|
||||
</span><span id="__span-21-20"><a id="__codelineno-21-20" name="__codelineno-21-20" href="#__codelineno-21-20"></a><span class="sd"> """</span>
|
||||
</span><span id="__span-21-21"><a id="__codelineno-21-21" name="__codelineno-21-21" href="#__codelineno-21-21"></a>
|
||||
</span><span id="__span-21-22"><a id="__codelineno-21-22" name="__codelineno-21-22" href="#__codelineno-21-22"></a> <span class="n">ALIASES</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"MY"</span><span class="p">,)</span>
|
||||
</span><span id="__span-21-23"><a id="__codelineno-21-23" name="__codelineno-21-23" href="#__codelineno-21-23"></a> <span class="n">GEOFENCE</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"US"</span><span class="p">,)</span>
|
||||
</span><span id="__span-21-24"><a id="__codelineno-21-24" name="__codelineno-21-24" href="#__codelineno-21-24"></a> <span class="n">TITLE_RE</span> <span class="o">=</span> <span class="sa">r</span><span class="s2">"^(?:https?://myservice\.com/watch/)?(?P<id>[\w-]+)"</span>
|
||||
</span><span id="__span-21-25"><a id="__codelineno-21-25" name="__codelineno-21-25" href="#__codelineno-21-25"></a>
|
||||
</span><span id="__span-21-26"><a id="__codelineno-21-26" name="__codelineno-21-26" href="#__codelineno-21-26"></a> <span class="nd">@staticmethod</span>
|
||||
</span><span id="__span-21-27"><a id="__codelineno-21-27" name="__codelineno-21-27" href="#__codelineno-21-27"></a> <span class="nd">@click</span><span class="o">.</span><span class="n">command</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s2">"MYSVC"</span><span class="p">,</span> <span class="n">short_help</span><span class="o">=</span><span class="s2">"https://myservice.com"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="vm">__doc__</span><span class="p">)</span>
|
||||
</span><span id="__span-21-28"><a id="__codelineno-21-28" name="__codelineno-21-28" href="#__codelineno-21-28"></a> <span class="nd">@click</span><span class="o">.</span><span class="n">argument</span><span class="p">(</span><span class="s2">"title"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">)</span>
|
||||
</span><span id="__span-21-29"><a id="__codelineno-21-29" name="__codelineno-21-29" href="#__codelineno-21-29"></a> <span class="nd">@click</span><span class="o">.</span><span class="n">pass_context</span>
|
||||
</span><span id="__span-21-30"><a id="__codelineno-21-30" name="__codelineno-21-30" href="#__codelineno-21-30"></a> <span class="k">def</span><span class="w"> </span><span class="nf">cli</span><span class="p">(</span><span class="n">ctx</span><span class="p">:</span> <span class="n">click</span><span class="o">.</span><span class="n">Context</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="s2">"MYSVC"</span><span class="p">:</span>
|
||||
</span><span id="__span-21-31"><a id="__codelineno-21-31" name="__codelineno-21-31" href="#__codelineno-21-31"></a> <span class="k">return</span> <span class="n">MYSVC</span><span class="p">(</span><span class="n">ctx</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
</span><span id="__span-21-32"><a id="__codelineno-21-32" name="__codelineno-21-32" href="#__codelineno-21-32"></a>
|
||||
</span><span id="__span-21-33"><a id="__codelineno-21-33" name="__codelineno-21-33" href="#__codelineno-21-33"></a> <span class="k">def</span><span class="w"> </span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ctx</span><span class="p">:</span> <span class="n">click</span><span class="o">.</span><span class="n">Context</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
|
||||
</span><span id="__span-21-34"><a id="__codelineno-21-34" name="__codelineno-21-34" href="#__codelineno-21-34"></a> <span class="bp">self</span><span class="o">.</span><span class="n">title</span> <span class="o">=</span> <span class="n">title</span>
|
||||
</span><span id="__span-21-35"><a id="__codelineno-21-35" name="__codelineno-21-35" href="#__codelineno-21-35"></a> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">ctx</span><span class="p">)</span>
|
||||
</span><span id="__span-21-36"><a id="__codelineno-21-36" name="__codelineno-21-36" href="#__codelineno-21-36"></a>
|
||||
</span><span id="__span-21-37"><a id="__codelineno-21-37" name="__codelineno-21-37" href="#__codelineno-21-37"></a> <span class="k">def</span><span class="w"> </span><span class="nf">authenticate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cookies</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">credential</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
||||
</span><span id="__span-21-38"><a id="__codelineno-21-38" name="__codelineno-21-38" href="#__codelineno-21-38"></a> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">authenticate</span><span class="p">(</span><span class="n">cookies</span><span class="p">,</span> <span class="n">credential</span><span class="p">)</span>
|
||||
</span><span id="__span-21-39"><a id="__codelineno-21-39" name="__codelineno-21-39" href="#__codelineno-21-39"></a> <span class="c1"># obtain any tokens here, e.g. self.token = ...</span>
|
||||
</span><span id="__span-21-40"><a id="__codelineno-21-40" name="__codelineno-21-40" href="#__codelineno-21-40"></a>
|
||||
</span><span id="__span-21-41"><a id="__codelineno-21-41" name="__codelineno-21-41" href="#__codelineno-21-41"></a> <span class="k">def</span><span class="w"> </span><span class="nf">get_titles</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Titles_T</span><span class="p">:</span>
|
||||
</span><span id="__span-21-42"><a id="__codelineno-21-42" name="__codelineno-21-42" href="#__codelineno-21-42"></a> <span class="n">match</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">TITLE_RE</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
|
||||
</span><span id="__span-21-43"><a id="__codelineno-21-43" name="__codelineno-21-43" href="#__codelineno-21-43"></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">match</span><span class="p">:</span>
|
||||
</span><span id="__span-21-44"><a id="__codelineno-21-44" name="__codelineno-21-44" href="#__codelineno-21-44"></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Could not parse a title ID."</span><span class="p">)</span>
|
||||
</span><span id="__span-21-45"><a id="__codelineno-21-45" name="__codelineno-21-45" href="#__codelineno-21-45"></a> <span class="n">meta</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">get</span><span class="p">(</span>
|
||||
</span><span id="__span-21-46"><a id="__codelineno-21-46" name="__codelineno-21-46" href="#__codelineno-21-46"></a> <span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"endpoints"</span><span class="p">][</span><span class="s2">"metadata"</span><span class="p">]</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">match</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="s2">"id"</span><span class="p">))</span>
|
||||
</span><span id="__span-21-47"><a id="__codelineno-21-47" name="__codelineno-21-47" href="#__codelineno-21-47"></a> <span class="p">)</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>
|
||||
</span><span id="__span-21-48"><a id="__codelineno-21-48" name="__codelineno-21-48" href="#__codelineno-21-48"></a> <span class="k">return</span> <span class="n">Movies</span><span class="p">([</span>
|
||||
</span><span id="__span-21-49"><a id="__codelineno-21-49" name="__codelineno-21-49" href="#__codelineno-21-49"></a> <span class="n">Movie</span><span class="p">(</span>
|
||||
</span><span id="__span-21-50"><a id="__codelineno-21-50" name="__codelineno-21-50" href="#__codelineno-21-50"></a> <span class="n">id_</span><span class="o">=</span><span class="n">meta</span><span class="p">[</span><span class="s2">"id"</span><span class="p">],</span>
|
||||
</span><span id="__span-21-51"><a id="__codelineno-21-51" name="__codelineno-21-51" href="#__codelineno-21-51"></a> <span class="n">service</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">,</span>
|
||||
</span><span id="__span-21-52"><a id="__codelineno-21-52" name="__codelineno-21-52" href="#__codelineno-21-52"></a> <span class="n">name</span><span class="o">=</span><span class="n">meta</span><span class="p">[</span><span class="s2">"title"</span><span class="p">],</span>
|
||||
</span><span id="__span-21-53"><a id="__codelineno-21-53" name="__codelineno-21-53" href="#__codelineno-21-53"></a> <span class="n">year</span><span class="o">=</span><span class="n">meta</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"year"</span><span class="p">)</span> <span class="ow">or</span> <span class="kc">None</span><span class="p">,</span>
|
||||
</span><span id="__span-21-54"><a id="__codelineno-21-54" name="__codelineno-21-54" href="#__codelineno-21-54"></a> <span class="n">language</span><span class="o">=</span><span class="n">meta</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"originalLanguage"</span><span class="p">),</span>
|
||||
</span><span id="__span-21-55"><a id="__codelineno-21-55" name="__codelineno-21-55" href="#__codelineno-21-55"></a> <span class="n">data</span><span class="o">=</span><span class="n">meta</span><span class="p">,</span>
|
||||
</span><span id="__span-21-56"><a id="__codelineno-21-56" name="__codelineno-21-56" href="#__codelineno-21-56"></a> <span class="p">)</span>
|
||||
</span><span id="__span-21-57"><a id="__codelineno-21-57" name="__codelineno-21-57" href="#__codelineno-21-57"></a> <span class="p">])</span>
|
||||
</span><span id="__span-21-58"><a id="__codelineno-21-58" name="__codelineno-21-58" href="#__codelineno-21-58"></a>
|
||||
</span><span id="__span-21-59"><a id="__codelineno-21-59" name="__codelineno-21-59" href="#__codelineno-21-59"></a> <span class="k">def</span><span class="w"> </span><span class="nf">get_tracks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Tracks</span><span class="p">:</span>
|
||||
</span><span id="__span-21-60"><a id="__codelineno-21-60" name="__codelineno-21-60" href="#__codelineno-21-60"></a> <span class="n">playback</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">get</span><span class="p">(</span>
|
||||
</span><span id="__span-21-61"><a id="__codelineno-21-61" name="__codelineno-21-61" href="#__codelineno-21-61"></a> <span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"endpoints"</span><span class="p">][</span><span class="s2">"playback"</span><span class="p">]</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">title</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
|
||||
</span><span id="__span-21-62"><a id="__codelineno-21-62" name="__codelineno-21-62" href="#__codelineno-21-62"></a> <span class="p">)</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>
|
||||
</span><span id="__span-21-63"><a id="__codelineno-21-63" name="__codelineno-21-63" href="#__codelineno-21-63"></a> <span class="k">return</span> <span class="n">DASH</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span>
|
||||
</span><span id="__span-21-64"><a id="__codelineno-21-64" name="__codelineno-21-64" href="#__codelineno-21-64"></a> <span class="n">url</span><span class="o">=</span><span class="n">playback</span><span class="p">[</span><span class="s2">"manifest_url"</span><span class="p">],</span> <span class="n">session</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">session</span>
|
||||
</span><span id="__span-21-65"><a id="__codelineno-21-65" name="__codelineno-21-65" href="#__codelineno-21-65"></a> <span class="p">)</span><span class="o">.</span><span class="n">to_tracks</span><span class="p">(</span><span class="n">language</span><span class="o">=</span><span class="n">title</span><span class="o">.</span><span class="n">language</span><span class="p">)</span>
|
||||
</span><span id="__span-21-66"><a id="__codelineno-21-66" name="__codelineno-21-66" href="#__codelineno-21-66"></a>
|
||||
</span><span id="__span-21-67"><a id="__codelineno-21-67" name="__codelineno-21-67" href="#__codelineno-21-67"></a> <span class="k">def</span><span class="w"> </span><span class="nf">get_chapters</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Chapters</span><span class="p">:</span>
|
||||
</span><span id="__span-21-68"><a id="__codelineno-21-68" name="__codelineno-21-68" href="#__codelineno-21-68"></a> <span class="k">return</span> <span class="n">Chapters</span><span class="p">()</span>
|
||||
</span><span id="__span-21-69"><a id="__codelineno-21-69" name="__codelineno-21-69" href="#__codelineno-21-69"></a>
|
||||
</span><span id="__span-21-70"><a id="__codelineno-21-70" name="__codelineno-21-70" href="#__codelineno-21-70"></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-71"><a id="__codelineno-21-71" name="__codelineno-21-71" href="#__codelineno-21-71"></a> <span class="n">res</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 class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"endpoints"</span><span class="p">][</span><span class="s2">"license"</span><span class="p">],</span> <span class="n">data</span><span class="o">=</span><span class="n">challenge</span><span class="p">)</span>
|
||||
</span><span id="__span-21-72"><a id="__codelineno-21-72" name="__codelineno-21-72" href="#__codelineno-21-72"></a> <span class="n">res</span><span class="o">.</span><span class="n">raise_for_status</span><span class="p">()</span>
|
||||
</span><span id="__span-21-73"><a id="__codelineno-21-73" name="__codelineno-21-73" href="#__codelineno-21-73"></a> <span class="k">return</span> <span class="n">res</span><span class="o">.</span><span class="n">content</span>
|
||||
<div class="language-python highlight"><span class="filename">services/MYSVC/__init__.py</span><pre><span></span><code><span id="__span-22-1"><a id="__codelineno-22-1" name="__codelineno-22-1" href="#__codelineno-22-1"></a><span class="kn">from</span><span class="w"> </span><span class="nn">__future__</span><span class="w"> </span><span class="kn">import</span> <span class="n">annotations</span>
|
||||
</span><span id="__span-22-2"><a id="__codelineno-22-2" name="__codelineno-22-2" href="#__codelineno-22-2"></a>
|
||||
</span><span id="__span-22-3"><a id="__codelineno-22-3" name="__codelineno-22-3" href="#__codelineno-22-3"></a><span class="kn">import</span><span class="w"> </span><span class="nn">re</span>
|
||||
</span><span id="__span-22-4"><a id="__codelineno-22-4" name="__codelineno-22-4" href="#__codelineno-22-4"></a><span class="kn">from</span><span class="w"> </span><span class="nn">typing</span><span class="w"> </span><span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Optional</span>
|
||||
</span><span id="__span-22-5"><a id="__codelineno-22-5" name="__codelineno-22-5" href="#__codelineno-22-5"></a>
|
||||
</span><span id="__span-22-6"><a id="__codelineno-22-6" name="__codelineno-22-6" href="#__codelineno-22-6"></a><span class="kn">import</span><span class="w"> </span><span class="nn">click</span>
|
||||
</span><span id="__span-22-7"><a id="__codelineno-22-7" name="__codelineno-22-7" href="#__codelineno-22-7"></a>
|
||||
</span><span id="__span-22-8"><a id="__codelineno-22-8" name="__codelineno-22-8" href="#__codelineno-22-8"></a><span class="kn">from</span><span class="w"> </span><span class="nn">unshackle.core.manifests</span><span class="w"> </span><span class="kn">import</span> <span class="n">DASH</span>
|
||||
</span><span id="__span-22-9"><a id="__codelineno-22-9" name="__codelineno-22-9" href="#__codelineno-22-9"></a><span class="kn">from</span><span class="w"> </span><span class="nn">unshackle.core.service</span><span class="w"> </span><span class="kn">import</span> <span class="n">Service</span>
|
||||
</span><span id="__span-22-10"><a id="__codelineno-22-10" name="__codelineno-22-10" href="#__codelineno-22-10"></a><span class="kn">from</span><span class="w"> </span><span class="nn">unshackle.core.titles</span><span class="w"> </span><span class="kn">import</span> <span class="n">Movie</span><span class="p">,</span> <span class="n">Movies</span><span class="p">,</span> <span class="n">Title_T</span><span class="p">,</span> <span class="n">Titles_T</span>
|
||||
</span><span id="__span-22-11"><a id="__codelineno-22-11" name="__codelineno-22-11" href="#__codelineno-22-11"></a><span class="kn">from</span><span class="w"> </span><span class="nn">unshackle.core.tracks</span><span class="w"> </span><span class="kn">import</span> <span class="n">Chapters</span><span class="p">,</span> <span class="n">Tracks</span>
|
||||
</span><span id="__span-22-12"><a id="__codelineno-22-12" name="__codelineno-22-12" href="#__codelineno-22-12"></a>
|
||||
</span><span id="__span-22-13"><a id="__codelineno-22-13" name="__codelineno-22-13" href="#__codelineno-22-13"></a>
|
||||
</span><span id="__span-22-14"><a id="__codelineno-22-14" name="__codelineno-22-14" href="#__codelineno-22-14"></a><span class="k">class</span><span class="w"> </span><span class="nc">MYSVC</span><span class="p">(</span><span class="n">Service</span><span class="p">):</span>
|
||||
</span><span id="__span-22-15"><a id="__codelineno-22-15" name="__codelineno-22-15" href="#__codelineno-22-15"></a><span class="w"> </span><span class="sd">"""</span>
|
||||
</span><span id="__span-22-16"><a id="__codelineno-22-16" name="__codelineno-22-16" href="#__codelineno-22-16"></a><span class="sd"> MyService - https://myservice.com</span>
|
||||
</span><span id="__span-22-17"><a id="__codelineno-22-17" name="__codelineno-22-17" href="#__codelineno-22-17"></a>
|
||||
</span><span id="__span-22-18"><a id="__codelineno-22-18" name="__codelineno-22-18" href="#__codelineno-22-18"></a><span class="sd"> \b</span>
|
||||
</span><span id="__span-22-19"><a id="__codelineno-22-19" name="__codelineno-22-19" href="#__codelineno-22-19"></a><span class="sd"> Usage: unshackle dl MYSVC <title-id-or-url></span>
|
||||
</span><span id="__span-22-20"><a id="__codelineno-22-20" name="__codelineno-22-20" href="#__codelineno-22-20"></a><span class="sd"> """</span>
|
||||
</span><span id="__span-22-21"><a id="__codelineno-22-21" name="__codelineno-22-21" href="#__codelineno-22-21"></a>
|
||||
</span><span id="__span-22-22"><a id="__codelineno-22-22" name="__codelineno-22-22" href="#__codelineno-22-22"></a> <span class="n">ALIASES</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"MY"</span><span class="p">,)</span>
|
||||
</span><span id="__span-22-23"><a id="__codelineno-22-23" name="__codelineno-22-23" href="#__codelineno-22-23"></a> <span class="n">GEOFENCE</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"US"</span><span class="p">,)</span>
|
||||
</span><span id="__span-22-24"><a id="__codelineno-22-24" name="__codelineno-22-24" href="#__codelineno-22-24"></a> <span class="n">TITLE_RE</span> <span class="o">=</span> <span class="sa">r</span><span class="s2">"^(?:https?://myservice\.com/watch/)?(?P<id>[\w-]+)"</span>
|
||||
</span><span id="__span-22-25"><a id="__codelineno-22-25" name="__codelineno-22-25" href="#__codelineno-22-25"></a>
|
||||
</span><span id="__span-22-26"><a id="__codelineno-22-26" name="__codelineno-22-26" href="#__codelineno-22-26"></a> <span class="nd">@staticmethod</span>
|
||||
</span><span id="__span-22-27"><a id="__codelineno-22-27" name="__codelineno-22-27" href="#__codelineno-22-27"></a> <span class="nd">@click</span><span class="o">.</span><span class="n">command</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s2">"MYSVC"</span><span class="p">,</span> <span class="n">short_help</span><span class="o">=</span><span class="s2">"https://myservice.com"</span><span class="p">,</span> <span class="n">help</span><span class="o">=</span><span class="vm">__doc__</span><span class="p">)</span>
|
||||
</span><span id="__span-22-28"><a id="__codelineno-22-28" name="__codelineno-22-28" href="#__codelineno-22-28"></a> <span class="nd">@click</span><span class="o">.</span><span class="n">argument</span><span class="p">(</span><span class="s2">"title"</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">str</span><span class="p">)</span>
|
||||
</span><span id="__span-22-29"><a id="__codelineno-22-29" name="__codelineno-22-29" href="#__codelineno-22-29"></a> <span class="nd">@click</span><span class="o">.</span><span class="n">pass_context</span>
|
||||
</span><span id="__span-22-30"><a id="__codelineno-22-30" name="__codelineno-22-30" href="#__codelineno-22-30"></a> <span class="k">def</span><span class="w"> </span><span class="nf">cli</span><span class="p">(</span><span class="n">ctx</span><span class="p">:</span> <span class="n">click</span><span class="o">.</span><span class="n">Context</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">:</span> <span class="n">Any</span><span class="p">)</span> <span class="o">-></span> <span class="s2">"MYSVC"</span><span class="p">:</span>
|
||||
</span><span id="__span-22-31"><a id="__codelineno-22-31" name="__codelineno-22-31" href="#__codelineno-22-31"></a> <span class="k">return</span> <span class="n">MYSVC</span><span class="p">(</span><span class="n">ctx</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
</span><span id="__span-22-32"><a id="__codelineno-22-32" name="__codelineno-22-32" href="#__codelineno-22-32"></a>
|
||||
</span><span id="__span-22-33"><a id="__codelineno-22-33" name="__codelineno-22-33" href="#__codelineno-22-33"></a> <span class="k">def</span><span class="w"> </span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ctx</span><span class="p">:</span> <span class="n">click</span><span class="o">.</span><span class="n">Context</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
|
||||
</span><span id="__span-22-34"><a id="__codelineno-22-34" name="__codelineno-22-34" href="#__codelineno-22-34"></a> <span class="bp">self</span><span class="o">.</span><span class="n">title</span> <span class="o">=</span> <span class="n">title</span>
|
||||
</span><span id="__span-22-35"><a id="__codelineno-22-35" name="__codelineno-22-35" href="#__codelineno-22-35"></a> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">ctx</span><span class="p">)</span>
|
||||
</span><span id="__span-22-36"><a id="__codelineno-22-36" name="__codelineno-22-36" href="#__codelineno-22-36"></a>
|
||||
</span><span id="__span-22-37"><a id="__codelineno-22-37" name="__codelineno-22-37" href="#__codelineno-22-37"></a> <span class="k">def</span><span class="w"> </span><span class="nf">authenticate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cookies</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">credential</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
||||
</span><span id="__span-22-38"><a id="__codelineno-22-38" name="__codelineno-22-38" href="#__codelineno-22-38"></a> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">authenticate</span><span class="p">(</span><span class="n">cookies</span><span class="p">,</span> <span class="n">credential</span><span class="p">)</span>
|
||||
</span><span id="__span-22-39"><a id="__codelineno-22-39" name="__codelineno-22-39" href="#__codelineno-22-39"></a> <span class="c1"># obtain any tokens here, e.g. self.token = ...</span>
|
||||
</span><span id="__span-22-40"><a id="__codelineno-22-40" name="__codelineno-22-40" href="#__codelineno-22-40"></a>
|
||||
</span><span id="__span-22-41"><a id="__codelineno-22-41" name="__codelineno-22-41" href="#__codelineno-22-41"></a> <span class="k">def</span><span class="w"> </span><span class="nf">get_titles</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">Titles_T</span><span class="p">:</span>
|
||||
</span><span id="__span-22-42"><a id="__codelineno-22-42" name="__codelineno-22-42" href="#__codelineno-22-42"></a> <span class="n">match</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">TITLE_RE</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">title</span><span class="p">)</span>
|
||||
</span><span id="__span-22-43"><a id="__codelineno-22-43" name="__codelineno-22-43" href="#__codelineno-22-43"></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">match</span><span class="p">:</span>
|
||||
</span><span id="__span-22-44"><a id="__codelineno-22-44" name="__codelineno-22-44" href="#__codelineno-22-44"></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Could not parse a title ID."</span><span class="p">)</span>
|
||||
</span><span id="__span-22-45"><a id="__codelineno-22-45" name="__codelineno-22-45" href="#__codelineno-22-45"></a> <span class="n">meta</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">get</span><span class="p">(</span>
|
||||
</span><span id="__span-22-46"><a id="__codelineno-22-46" name="__codelineno-22-46" href="#__codelineno-22-46"></a> <span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"endpoints"</span><span class="p">][</span><span class="s2">"metadata"</span><span class="p">]</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">match</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="s2">"id"</span><span class="p">))</span>
|
||||
</span><span id="__span-22-47"><a id="__codelineno-22-47" name="__codelineno-22-47" href="#__codelineno-22-47"></a> <span class="p">)</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>
|
||||
</span><span id="__span-22-48"><a id="__codelineno-22-48" name="__codelineno-22-48" href="#__codelineno-22-48"></a> <span class="k">return</span> <span class="n">Movies</span><span class="p">([</span>
|
||||
</span><span id="__span-22-49"><a id="__codelineno-22-49" name="__codelineno-22-49" href="#__codelineno-22-49"></a> <span class="n">Movie</span><span class="p">(</span>
|
||||
</span><span id="__span-22-50"><a id="__codelineno-22-50" name="__codelineno-22-50" href="#__codelineno-22-50"></a> <span class="n">id_</span><span class="o">=</span><span class="n">meta</span><span class="p">[</span><span class="s2">"id"</span><span class="p">],</span>
|
||||
</span><span id="__span-22-51"><a id="__codelineno-22-51" name="__codelineno-22-51" href="#__codelineno-22-51"></a> <span class="n">service</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">,</span>
|
||||
</span><span id="__span-22-52"><a id="__codelineno-22-52" name="__codelineno-22-52" href="#__codelineno-22-52"></a> <span class="n">name</span><span class="o">=</span><span class="n">meta</span><span class="p">[</span><span class="s2">"title"</span><span class="p">],</span>
|
||||
</span><span id="__span-22-53"><a id="__codelineno-22-53" name="__codelineno-22-53" href="#__codelineno-22-53"></a> <span class="n">year</span><span class="o">=</span><span class="n">meta</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"year"</span><span class="p">)</span> <span class="ow">or</span> <span class="kc">None</span><span class="p">,</span>
|
||||
</span><span id="__span-22-54"><a id="__codelineno-22-54" name="__codelineno-22-54" href="#__codelineno-22-54"></a> <span class="n">language</span><span class="o">=</span><span class="n">meta</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"originalLanguage"</span><span class="p">),</span>
|
||||
</span><span id="__span-22-55"><a id="__codelineno-22-55" name="__codelineno-22-55" href="#__codelineno-22-55"></a> <span class="n">data</span><span class="o">=</span><span class="n">meta</span><span class="p">,</span>
|
||||
</span><span id="__span-22-56"><a id="__codelineno-22-56" name="__codelineno-22-56" href="#__codelineno-22-56"></a> <span class="p">)</span>
|
||||
</span><span id="__span-22-57"><a id="__codelineno-22-57" name="__codelineno-22-57" href="#__codelineno-22-57"></a> <span class="p">])</span>
|
||||
</span><span id="__span-22-58"><a id="__codelineno-22-58" name="__codelineno-22-58" href="#__codelineno-22-58"></a>
|
||||
</span><span id="__span-22-59"><a id="__codelineno-22-59" name="__codelineno-22-59" href="#__codelineno-22-59"></a> <span class="k">def</span><span class="w"> </span><span class="nf">get_tracks</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Tracks</span><span class="p">:</span>
|
||||
</span><span id="__span-22-60"><a id="__codelineno-22-60" name="__codelineno-22-60" href="#__codelineno-22-60"></a> <span class="n">playback</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">get</span><span class="p">(</span>
|
||||
</span><span id="__span-22-61"><a id="__codelineno-22-61" name="__codelineno-22-61" href="#__codelineno-22-61"></a> <span class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"endpoints"</span><span class="p">][</span><span class="s2">"playback"</span><span class="p">]</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="n">title</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
|
||||
</span><span id="__span-22-62"><a id="__codelineno-22-62" name="__codelineno-22-62" href="#__codelineno-22-62"></a> <span class="p">)</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>
|
||||
</span><span id="__span-22-63"><a id="__codelineno-22-63" name="__codelineno-22-63" href="#__codelineno-22-63"></a> <span class="k">return</span> <span class="n">DASH</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span>
|
||||
</span><span id="__span-22-64"><a id="__codelineno-22-64" name="__codelineno-22-64" href="#__codelineno-22-64"></a> <span class="n">url</span><span class="o">=</span><span class="n">playback</span><span class="p">[</span><span class="s2">"manifest_url"</span><span class="p">],</span> <span class="n">session</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">session</span>
|
||||
</span><span id="__span-22-65"><a id="__codelineno-22-65" name="__codelineno-22-65" href="#__codelineno-22-65"></a> <span class="p">)</span><span class="o">.</span><span class="n">to_tracks</span><span class="p">(</span><span class="n">language</span><span class="o">=</span><span class="n">title</span><span class="o">.</span><span class="n">language</span><span class="p">)</span>
|
||||
</span><span id="__span-22-66"><a id="__codelineno-22-66" name="__codelineno-22-66" href="#__codelineno-22-66"></a>
|
||||
</span><span id="__span-22-67"><a id="__codelineno-22-67" name="__codelineno-22-67" href="#__codelineno-22-67"></a> <span class="k">def</span><span class="w"> </span><span class="nf">get_chapters</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">title</span><span class="p">:</span> <span class="n">Title_T</span><span class="p">)</span> <span class="o">-></span> <span class="n">Chapters</span><span class="p">:</span>
|
||||
</span><span id="__span-22-68"><a id="__codelineno-22-68" name="__codelineno-22-68" href="#__codelineno-22-68"></a> <span class="k">return</span> <span class="n">Chapters</span><span class="p">()</span>
|
||||
</span><span id="__span-22-69"><a id="__codelineno-22-69" name="__codelineno-22-69" href="#__codelineno-22-69"></a>
|
||||
</span><span id="__span-22-70"><a id="__codelineno-22-70" name="__codelineno-22-70" href="#__codelineno-22-70"></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-22-71"><a id="__codelineno-22-71" name="__codelineno-22-71" href="#__codelineno-22-71"></a> <span class="n">res</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 class="bp">self</span><span class="o">.</span><span class="n">config</span><span class="p">[</span><span class="s2">"endpoints"</span><span class="p">][</span><span class="s2">"license"</span><span class="p">],</span> <span class="n">data</span><span class="o">=</span><span class="n">challenge</span><span class="p">)</span>
|
||||
</span><span id="__span-22-72"><a id="__codelineno-22-72" name="__codelineno-22-72" href="#__codelineno-22-72"></a> <span class="n">res</span><span class="o">.</span><span class="n">raise_for_status</span><span class="p">()</span>
|
||||
</span><span id="__span-22-73"><a id="__codelineno-22-73" name="__codelineno-22-73" href="#__codelineno-22-73"></a> <span class="k">return</span> <span class="n">res</span><span class="o">.</span><span class="n">content</span>
|
||||
</span></code></pre></div>
|
||||
<div class="language-yaml highlight"><span class="filename">services/MYSVC/config.yaml</span><pre><span></span><code><span id="__span-22-1"><a id="__codelineno-22-1" name="__codelineno-22-1" href="#__codelineno-22-1"></a><span class="nt">endpoints</span><span class="p">:</span>
|
||||
</span><span id="__span-22-2"><a id="__codelineno-22-2" name="__codelineno-22-2" href="#__codelineno-22-2"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://api.myservice.com/v1/metadata/{id}</span>
|
||||
</span><span id="__span-22-3"><a id="__codelineno-22-3" name="__codelineno-22-3" href="#__codelineno-22-3"></a><span class="w"> </span><span class="nt">playback</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://api.myservice.com/v1/playback/{id}</span>
|
||||
</span><span id="__span-22-4"><a id="__codelineno-22-4" name="__codelineno-22-4" href="#__codelineno-22-4"></a><span class="w"> </span><span class="nt">license</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://api.myservice.com/v1/license/widevine</span>
|
||||
<div class="language-yaml highlight"><span class="filename">services/MYSVC/config.yaml</span><pre><span></span><code><span id="__span-23-1"><a id="__codelineno-23-1" name="__codelineno-23-1" href="#__codelineno-23-1"></a><span class="nt">endpoints</span><span class="p">:</span>
|
||||
</span><span id="__span-23-2"><a id="__codelineno-23-2" name="__codelineno-23-2" href="#__codelineno-23-2"></a><span class="w"> </span><span class="nt">metadata</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://api.myservice.com/v1/metadata/{id}</span>
|
||||
</span><span id="__span-23-3"><a id="__codelineno-23-3" name="__codelineno-23-3" href="#__codelineno-23-3"></a><span class="w"> </span><span class="nt">playback</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://api.myservice.com/v1/playback/{id}</span>
|
||||
</span><span id="__span-23-4"><a id="__codelineno-23-4" name="__codelineno-23-4" href="#__codelineno-23-4"></a><span class="w"> </span><span class="nt">license</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://api.myservice.com/v1/license/widevine</span>
|
||||
</span></code></pre></div>
|
||||
<p>Try it with:</p>
|
||||
<div class="language-bash highlight"><pre><span></span><code><span id="__span-23-1"><a id="__codelineno-23-1" name="__codelineno-23-1" href="#__codelineno-23-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>MYSVC<span class="w"> </span>https://myservice.com/watch/abc123
|
||||
<div class="language-bash highlight"><pre><span></span><code><span id="__span-24-1"><a id="__codelineno-24-1" name="__codelineno-24-1" href="#__codelineno-24-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>MYSVC<span class="w"> </span>https://myservice.com/watch/abc123
|
||||
</span></code></pre></div>
|
||||
<hr />
|
||||
<h2 id="checklist">Checklist<a class="headerlink" href="#checklist" title="Permanent link">¶</a></h2>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2696,7 +2696,9 @@ The CORS headers expose these headers and <code>Retry-After</code> to a browser
|
||||
</tbody>
|
||||
</table>
|
||||
<p>A <code>--remote</code> client that gets a <code>429</code> with <code>Retry-After</code> shows a countdown, waits that time
|
||||
(one hour at most), and then sends the request again. It stops after 3 waits for one request.</p>
|
||||
(one hour at most), and then sends the request again. It stops after 3 waits for one request.
|
||||
The keep-alive, the poll for CDM calls, the health check and the drain check do not wait: each
|
||||
tries again at its next interval.</p>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title"><code>429</code> is not the <code>RATE_LIMITED</code> error body</p>
|
||||
<p><code>RATE_LIMITED</code> in <a href="../errors/">Errors</a> is a <em>service</em> rate limit that a handler raises, and it
|
||||
@@ -2878,7 +2880,7 @@ that reads <code>error_code</code> to classify a <code>429</code> must cope with
|
||||
</span></code></pre></div>
|
||||
<p>The REST API authenticates with <code>X-Secret-Key</code>. The middleware advertises <code>Authorization</code> because the co-hosted pywidevine / pyplayready CDM endpoints use it. <code>PUT</code> appears in the allowed-methods list, but no REST route uses it. Only <code>GET</code>, <code>POST</code>, and <code>DELETE</code> have routes.</p>
|
||||
<h3 id="where-device-access-is-read">Where device access is read<a class="headerlink" href="#where-device-access-is-read" title="Permanent link">¶</a></h3>
|
||||
<p>The map of accepted API keys lives at <code>request.app["config"]["users"]</code>. For DRM operations, an API key's permitted Widevine devices come from its <code>devices</code> list, and PlayReady devices from <code>playready_devices</code>. The server uses the first configured device when a request does not (or may not) override it. A server-wide <code>config.cdm[<service>]</code> mapping, if present, takes precedence over the API key's device list when the server chooses which device to use.</p>
|
||||
<p>The map of accepted API keys lives at <code>request.app["config"]["users"]</code>. For DRM operations, an API key's permitted Widevine devices come from its <code>devices</code> list, and PlayReady devices from <code>playready_devices</code>. The server uses the first configured device when a request does not (or may not) override it. A <code>cdm</code> entry for the service takes precedence over the API key's device list when the server chooses which device to use: the API key's own <code>serve.users.<key>.cdm</code> entry, else the server-wide <code>config.cdm[<service>]</code> mapping.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2236,6 +2236,9 @@ have their own key: a user key or a tier key never opens them.</p>
|
||||
</span><span id="__span-0-4"><a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="w"> </span><span class="nt">key</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">a-long-random-string</span>
|
||||
</span></code></pre></div>
|
||||
<p>Without <code>dashboard.key</code> the server does not register the routes, and they answer <code>404</code>.
|
||||
A config reload that removes the dashboard key closes the dashboard: the routes answer <code>404</code> and
|
||||
an open <code>/api/dashboard/events</code> connection ends. To add a dashboard key to a server that started
|
||||
without one, restart it.
|
||||
<code>serve --no-key</code> turns off user authentication only; the dashboard key stays required.
|
||||
Once the dashboard key is set, every <code>/api/dashboard/</code> request must carry it in
|
||||
<code>X-Secret-Key</code>.
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -1960,6 +1960,17 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#get-apisessionsession_idchannel" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
GET /api/session/{session_id}/channel
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -2059,6 +2070,17 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#post-apisessionsession_idkeys" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
POST /api/session/{session_id}/keys
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -2875,6 +2897,17 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#get-apisessionsession_idchannel" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
GET /api/session/{session_id}/channel
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -2974,6 +3007,17 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#post-apisessionsession_idkeys" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
POST /api/session/{session_id}/keys
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -3091,7 +3135,7 @@
|
||||
<li><strong>CORS.</strong> Every response carries permissive CORS headers, and the server answers <code>OPTIONS</code> preflight requests automatically.</li>
|
||||
<li><strong>Compression.</strong> JSON responses of 256 bytes or more are gzip-compressed when the client sends <code>Accept-Encoding: gzip</code>. A <a href="#slow-responses">slow response</a> is not compressed.</li>
|
||||
<li><strong>Service allowlist.</strong> The effective allowlist for your API key filters the service-facing endpoints (the intersection of the global <code>serve.services</code> list and your per-key list). The server treats services you cannot use as unknown.</li>
|
||||
<li><strong>Remote services.</strong> A full-mode server can run a service through one of its own <code>remote_services</code> servers (see <a href="../remote-sessions/">Remote sessions</a>). <code>GET /api/config</code> lists their names in <code>remote_services</code>, and <code>GET /api/services?remote=<name></code> lists that server's services, each with <code>remote</code> set to the name. Add <code>"remote": "<name>"</code> to <code>POST /api/search</code>, <code>/api/list-titles</code>, <code>/api/list-tracks</code> or <code>/api/download</code>, and the server opens a remote session with its own key for that server: the remote logs in and resolves titles, tracks and licences, and a download still runs, decrypts and muxes here. The tag may be any case or an alias, and your allowlist applies to it. An unknown name is <code>400 INVALID_PARAMETERS</code>, a server that does not answer is <code>SERVICE_UNAVAILABLE</code>, and a tag it does not offer is <code>INVALID_SERVICE</code>. List calls from the same API key for the same title, profile, proxy, client region and service options share one remote session, which closes after 120 seconds unused. An optional <code>client_name</code> names your client on the remote server's dashboard as <code>serve (<client_name>)</code>. A relayed search opens no remote session. The server sends its own credentials, cookies and cache for the <code>profile</code> with the search. A service that searches with no login gets none of them. A <code>--remote-only</code> server does not relay. A remote login that waits on you (a pair code or URL to approve on another device) cannot answer through a list call, so poll <code>GET /api/remote/logins</code> alongside it: each entry carries the login's <code>notice</code>, and its <code>prompt</code> when it asks a question (an OTP), which you answer with <code>POST /api/remote/logins/{id}/input</code> and <code>{"response": "..."}</code>. A remote download job shows the same text as its own <code>notice</code>, and asks a question (an OTP) through <code>input_prompt</code> as a local job does.</li>
|
||||
<li><strong>Remote services.</strong> A full-mode server can run a service through one of its own <code>remote_services</code> servers (see <a href="../remote-sessions/">Remote sessions</a>). <code>GET /api/config</code> lists their names in <code>remote_services</code>, and <code>GET /api/services?remote=<name></code> lists that server's services, each with <code>remote</code> set to the name. Add <code>"remote": "<name>"</code> to <code>POST /api/search</code>, <code>/api/list-titles</code>, <code>/api/list-tracks</code> or <code>/api/download</code>, and the server opens a remote session with its own key for that server: the remote logs in and resolves titles, tracks and licences, and a download still runs, decrypts and muxes here. The tag may be any case or an alias, and your allowlist applies to it. An unknown name is <code>400 INVALID_PARAMETERS</code>, a server that does not answer is <code>SERVICE_UNAVAILABLE</code>, and a tag it does not offer is <code>INVALID_SERVICE</code>. List calls from the same API key for the same title, profile, proxy, client region and service options share one remote session, which closes after 120 seconds unused. An optional <code>client_name</code> names your client on the remote server's dashboard as <code>serve (<client_name>)</code>. A relayed search opens no remote session. The server sends its own credentials, cookies and cache for the <code>profile</code> with the search. A service that searches with no login gets none of them. A <code>--remote-only</code> server does not relay. A remote login that waits on you (a pair code or URL to approve on another device) cannot answer through a list call, so poll <code>GET /api/remote/logins</code> alongside it: each entry carries the login's <code>notice</code>, its <code>qr</code> (the text of a QR code to scan, or null), and its <code>prompt</code> when it asks a question (an OTP), which you answer with <code>POST /api/remote/logins/{id}/input</code> and <code>{"response": "..."}</code>. A remote download job shows the same text as its own <code>notice</code>, and asks a question (an OTP) through <code>input_prompt</code> as a local job does.</li>
|
||||
</ul>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Error responses have two shapes</p>
|
||||
@@ -3533,6 +3577,12 @@ through the <code>wanted</code> parameter.</p>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>availability</code></td>
|
||||
<td>object</td>
|
||||
<td>all</td>
|
||||
<td>Optional account-scoped metadata: <code>paid</code> is a boolean describing the catalogue offer; <code>access</code> is <code>"granted"</code>, <code>"denied"</code>, or <code>"unknown"</code>. Both fields are optional; missing or unknown access is not denial. Only these allowlisted fields are forwarded, including through remote services.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>part</code></td>
|
||||
<td>integer</td>
|
||||
<td>episode</td>
|
||||
@@ -3703,7 +3753,7 @@ ignore it safely. See <a href="../../creating-a-service/#split-episodes">Split e
|
||||
</span><span id="__span-8-6"><a id="__codelineno-8-6" name="__codelineno-8-6" href="#__codelineno-8-6"></a><span class="w"> </span><span class="nt">"bitrate"</span><span class="p">:</span><span class="w"> </span><span class="mi">8000</span><span class="p">,</span><span class="w"> </span><span class="nt">"bitrate_bps"</span><span class="p">:</span><span class="w"> </span><span class="mi">8000000</span><span class="p">,</span><span class="w"> </span><span class="nt">"width"</span><span class="p">:</span><span class="w"> </span><span class="mi">3840</span><span class="p">,</span><span class="w"> </span><span class="nt">"height"</span><span class="p">:</span><span class="w"> </span><span class="mi">2160</span><span class="p">,</span>
|
||||
</span><span id="__span-8-7"><a id="__codelineno-8-7" name="__codelineno-8-7" href="#__codelineno-8-7"></a><span class="w"> </span><span class="nt">"resolution"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2160p"</span><span class="p">,</span><span class="w"> </span><span class="nt">"fps"</span><span class="p">:</span><span class="w"> </span><span class="s2">"24"</span><span class="p">,</span><span class="w"> </span><span class="nt">"range"</span><span class="p">:</span><span class="w"> </span><span class="s2">"HDR10"</span><span class="p">,</span>
|
||||
</span><span id="__span-8-8"><a id="__codelineno-8-8" name="__codelineno-8-8" href="#__codelineno-8-8"></a><span class="w"> </span><span class="nt">"range_display"</span><span class="p">:</span><span class="w"> </span><span class="s2">"HDR"</span><span class="p">,</span><span class="w"> </span><span class="nt">"scan_type"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w"> </span><span class="nt">"closed_captions"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span>
|
||||
</span><span id="__span-8-9"><a id="__codelineno-8-9" name="__codelineno-8-9" href="#__codelineno-8-9"></a><span class="w"> </span><span class="nt">"dv_compatible_bitstream"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"> </span><span class="nt">"hdr10plus"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"> </span><span class="nt">"hdr10_base"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"> </span><span class="nt">"language"</span><span class="p">:</span><span class="w"> </span><span class="s2">"en"</span><span class="p">,</span>
|
||||
</span><span id="__span-8-9"><a id="__codelineno-8-9" name="__codelineno-8-9" href="#__codelineno-8-9"></a><span class="w"> </span><span class="nt">"dv_compatible_bitstream"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"> </span><span class="nt">"hdr10plus"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"> </span><span class="nt">"hdr10_base"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"> </span><span class="nt">"stereo"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"> </span><span class="nt">"language"</span><span class="p">:</span><span class="w"> </span><span class="s2">"en"</span><span class="p">,</span>
|
||||
</span><span id="__span-8-10"><a id="__codelineno-8-10" name="__codelineno-8-10" href="#__codelineno-8-10"></a><span class="w"> </span><span class="nt">"is_original_lang"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
||||
</span><span id="__span-8-11"><a id="__codelineno-8-11" name="__codelineno-8-11" href="#__codelineno-8-11"></a><span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w"> </span><span class="nt">"track_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"English"</span><span class="p">,</span><span class="w"> </span><span class="nt">"needs_repack"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"> </span><span class="nt">"edition"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w"> </span><span class="nt">"note"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w"> </span><span class="nt">"data"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span>
|
||||
</span><span id="__span-8-12"><a id="__codelineno-8-12" name="__codelineno-8-12" href="#__codelineno-8-12"></a><span class="w"> </span><span class="nt">"drm"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w"> </span><span class="nt">"descriptor"</span><span class="p">:</span><span class="w"> </span><span class="s2">"DASH"</span>
|
||||
@@ -3840,7 +3890,7 @@ ignore it safely. See <a href="../../creating-a-service/#split-episodes">Split e
|
||||
<td><code>quality</code></td>
|
||||
<td>int[]</td>
|
||||
<td><code>[]</code></td>
|
||||
<td>Target resolution(s); best available if empty.</td>
|
||||
<td>Target resolution(s); best available if empty, or the lowest with <code>worst</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>vcodec</code></td>
|
||||
@@ -3912,19 +3962,25 @@ ignore it safely. See <a href="../../creating-a-service/#split-episodes">Split e
|
||||
<td><code>require_audio</code></td>
|
||||
<td>string[]</td>
|
||||
<td><code>[]</code></td>
|
||||
<td>Audio languages that must exist. The job fails if one is missing, even with <code>best_available</code>.</td>
|
||||
<td>Audio languages that must exist. The job fails if one is missing, even with <code>best_available</code>, or skips the title with <code>skip_missing</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>require_video</code></td>
|
||||
<td>string[]</td>
|
||||
<td><code>[]</code></td>
|
||||
<td>Video languages that must exist. The job fails if one is missing, even with <code>best_available</code>.</td>
|
||||
<td>Video languages that must exist. The job fails if one is missing, even with <code>best_available</code>, or skips the title with <code>skip_missing</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>require_subs</code></td>
|
||||
<td>string[]</td>
|
||||
<td><code>[]</code></td>
|
||||
<td>Subtitle languages that must exist. The job fails if one is missing. <code>s_lang</code> still decides what to keep.</td>
|
||||
<td>Subtitle languages that must exist. The job fails if one is missing, or skips the title with <code>skip_missing</code>. <code>s_lang</code> still decides what to keep.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>skip_missing</code></td>
|
||||
<td>boolean</td>
|
||||
<td><code>false</code></td>
|
||||
<td>Skip a title that misses a required language or track, and continue with the next title. The job's <code>skipped_titles</code> lists each skip. The job fails when it has one title or skips every title.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>forced_subs</code></td>
|
||||
@@ -3966,7 +4022,7 @@ ignore it safely. See <a href="../../creating-a-service/#split-episodes">Split e
|
||||
<td><code>video_only</code> / <code>audio_only</code> / <code>subs_only</code> / <code>chapters_only</code></td>
|
||||
<td>boolean</td>
|
||||
<td><code>false</code></td>
|
||||
<td>Track-type restriction (at most one).</td>
|
||||
<td>Track-type restriction. Two or more combine, as on the CLI.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>no_subs</code> / <code>no_audio</code> / <code>no_chapters</code> / <code>no_video</code> / <code>no_attachments</code></td>
|
||||
@@ -3994,9 +4050,9 @@ ignore it safely. See <a href="../../creating-a-service/#split-episodes">Split e
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>slow</code></td>
|
||||
<td>boolean/string</td>
|
||||
<td>boolean/string/array</td>
|
||||
<td><code>null</code></td>
|
||||
<td>Randomized delay between downloads.</td>
|
||||
<td>Randomized delay between downloads: <code>true</code> (60-120 seconds), <code>"MIN-MAX"</code>, or <code>[MIN, MAX]</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>split_audio</code></td>
|
||||
@@ -4026,7 +4082,7 @@ ignore it safely. See <a href="../../creating-a-service/#split-episodes">Split e
|
||||
<td><code>cdm_only</code></td>
|
||||
<td>boolean</td>
|
||||
<td><code>null</code></td>
|
||||
<td>Force CDM-only (<code>true</code>) or vault-only (<code>false</code>) key retrieval.</td>
|
||||
<td>Force CDM-only (<code>true</code>) or vault-only (<code>false</code>) key retrieval. With <code>remote</code>, <code>true</code> licenses every track with the CDM of this server and uses no CDM or vault of the remote server.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>proxy</code> / <code>no_proxy</code> / <code>no_proxy_download</code> / <code>proxy_download</code></td>
|
||||
@@ -4080,7 +4136,7 @@ ignore it safely. See <a href="../../creating-a-service/#split-episodes">Split e
|
||||
<td><code>worst</code></td>
|
||||
<td>boolean</td>
|
||||
<td><code>false</code></td>
|
||||
<td>Lowest bitrate within quality.</td>
|
||||
<td>Pick the lowest-bitrate video at each resolution in <code>quality</code>, or at the lowest resolution if <code>quality</code> is empty.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>best_available</code></td>
|
||||
@@ -4110,7 +4166,7 @@ ignore it safely. See <a href="../../creating-a-service/#split-episodes">Split e
|
||||
<td><code>tmdb_id</code> / <code>imdb_id</code> / <code>tvdb_id</code> / <code>anilist_id</code></td>
|
||||
<td>-</td>
|
||||
<td><code>null</code></td>
|
||||
<td>External ID overrides. Each resolves its metadata directly instead of by a title search, and is used for tagging. Set <code>enrich</code> to also take the title, year and original language. Give at most one of <code>tmdb_id</code>, <code>imdb_id</code> and <code>tvdb_id</code>, since unshackle resolves the others from it. Sending two returns <code>400</code>. <code>anilist_id</code> still combines with one of them. <code>tmdb_id</code> and <code>tvdb_id</code> must be positive integers, <code>imdb_id</code> must look like <code>tt1375666</code>, and <code>anilist_id</code> must be a positive integer or a string like <code>mal:12345</code>, or the request returns <code>400</code>. An ID whose provider is unconfigured, such as <code>tmdb_id</code> with no <code>tmdb_api_key</code>, fails the job rather than returning <code>400</code>. <code>anilist_id</code> needs no API key.</td>
|
||||
<td>External ID overrides. Each resolves its metadata directly instead of by a title search, and is used for tagging. Set <code>enrich</code> to also take the title, year and original language. Give at most one of <code>tmdb_id</code>, <code>imdb_id</code> and <code>tvdb_id</code>, since unshackle resolves the others from it. Sending two returns <code>400</code>. <code>anilist_id</code> still combines with one of them. <code>tmdb_id</code> and <code>tvdb_id</code> must be positive integers, <code>imdb_id</code> must look like <code>tt1375666</code>, and <code>anilist_id</code> must be a positive integer or a string like <code>mal:12345</code>, or the request returns <code>400</code>. An ID whose provider is unconfigured, such as <code>tmdb_id</code> with no <code>tmdb_api_key</code>, returns <code>400</code>. <code>anilist_id</code> needs no API key.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>tvdb_order</code></td>
|
||||
@@ -4128,7 +4184,7 @@ ignore it safely. See <a href="../../creating-a-service/#split-episodes">Split e
|
||||
<td><code>enrich</code></td>
|
||||
<td>boolean</td>
|
||||
<td><code>false</code></td>
|
||||
<td>Overwrite title, year and original language with the external source's. Needs one of <code>tmdb_id</code>, <code>imdb_id</code>, <code>tvdb_id</code> or <code>anilist_id</code>. Without one the job fails instead of returning <code>400</code>.</td>
|
||||
<td>Overwrite title, year and original language with the external source's. Needs one of <code>tmdb_id</code>, <code>imdb_id</code>, <code>tvdb_id</code> or <code>anilist_id</code>. Without one the request returns <code>400</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>daily</code></td>
|
||||
@@ -4150,7 +4206,7 @@ ignore it safely. See <a href="../../creating-a-service/#split-episodes">Split e
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Validation.</strong> Invalid values return <code>400 INVALID_PARAMETERS</code>. <code>vcodec</code>, <code>acodec</code> and <code>sub_format</code> take the same spellings as the CLI options of the same name (<code>unshackle dl --help</code> prints each list). The API and the CLI read one list, so they cannot disagree. <code>range</code> must be one of SDR/HDR10/HDR10P/DV/HLG/HYBRID, and <code>HDR10+</code> is also valid. The bitrate, download worker, and download counts must be positive integers. You may set at most one of the <code>*_only</code> flags. You cannot combine <code>no_subs</code> with <code>subs_only</code>, or <code>no_audio</code> with <code>audio_only</code>. The language fields (<code>lang</code>, <code>v_lang</code>, <code>a_lang</code>, <code>s_lang</code>, <code>forced_s_lang</code> and the <code>require_*</code> fields) must be arrays of strings: a single string such as <code>"en"</code> returns <code>400</code>. The server checks every other field with the type of its <code>dl</code> option. A <code>null</code> or an empty string gets the default from the table.</p>
|
||||
<p><strong>Validation.</strong> Invalid values return <code>400 INVALID_PARAMETERS</code>. <code>vcodec</code>, <code>acodec</code> and <code>sub_format</code> take the same spellings as the CLI options of the same name (<code>unshackle dl --help</code> prints each list). The API and the CLI read one list, so they cannot disagree. <code>range</code> must be one of SDR/HDR10/HDR10P/VIVID/DV/HLG/HYBRID, and <code>HDR10+</code> and <code>HDR Vivid</code> are also valid. The bitrate, download worker, and download counts must be positive integers. You cannot combine <code>no_subs</code> with <code>subs_only</code>, or <code>no_audio</code> with <code>audio_only</code>. The server runs the same option checks as <code>unshackle dl</code>, so a request that <code>dl</code> would refuse returns <code>400</code> when you submit it, and the message names the <code>dl</code> option. The language fields (<code>lang</code>, <code>v_lang</code>, <code>a_lang</code>, <code>s_lang</code>, <code>forced_s_lang</code> and the <code>require_*</code> fields) must be arrays of strings: a single string such as <code>"en"</code> returns <code>400</code>. The server checks every other field with the type of its <code>dl</code> option. A <code>null</code> or an empty string gets the default from the table.</p>
|
||||
<p><strong>Service options.</strong> A service's own CLI options travel in the same body. Send them in a nested
|
||||
<code>service_params</code> object, or as flat top-level keys. When the body has <code>service_params</code>, the server
|
||||
reads service options only from it, and every flat key is a <code>dl</code> value. Without it, a flat key that
|
||||
@@ -4306,11 +4362,13 @@ an HTTP caller would be remote code execution. You configure post-scripts only i
|
||||
</span><span id="__span-14-18"><a id="__codelineno-14-18" name="__codelineno-14-18" href="#__codelineno-14-18"></a><span class="w"> </span><span class="nt">"segments_total"</span><span class="p">:</span><span class="w"> </span><span class="mi">300</span><span class="p">,</span>
|
||||
</span><span id="__span-14-19"><a id="__codelineno-14-19" name="__codelineno-14-19" href="#__codelineno-14-19"></a><span class="w"> </span><span class="nt">"speed"</span><span class="p">:</span><span class="w"> </span><span class="s2">"5.2 MB/s"</span><span class="p">,</span>
|
||||
</span><span id="__span-14-20"><a id="__codelineno-14-20" name="__codelineno-14-20" href="#__codelineno-14-20"></a><span class="w"> </span><span class="nt">"skipped_subtitles"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span>
|
||||
</span><span id="__span-14-21"><a id="__codelineno-14-21" name="__codelineno-14-21" href="#__codelineno-14-21"></a><span class="w"> </span><span class="nt">"input_prompt"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span>
|
||||
</span><span id="__span-14-22"><a id="__codelineno-14-22" name="__codelineno-14-22" href="#__codelineno-14-22"></a><span class="w"> </span><span class="nt">"notice"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span>
|
||||
</span><span id="__span-14-23"><a id="__codelineno-14-23" name="__codelineno-14-23" href="#__codelineno-14-23"></a><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-14-24"><a id="__codelineno-14-24" name="__codelineno-14-24" href="#__codelineno-14-24"></a><span class="w"> </span><span class="p">]</span>
|
||||
</span><span id="__span-14-25"><a id="__codelineno-14-25" name="__codelineno-14-25" href="#__codelineno-14-25"></a><span class="p">}</span>
|
||||
</span><span id="__span-14-21"><a id="__codelineno-14-21" name="__codelineno-14-21" href="#__codelineno-14-21"></a><span class="w"> </span><span class="nt">"skipped_titles"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span>
|
||||
</span><span id="__span-14-22"><a id="__codelineno-14-22" name="__codelineno-14-22" href="#__codelineno-14-22"></a><span class="w"> </span><span class="nt">"input_prompt"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span>
|
||||
</span><span id="__span-14-23"><a id="__codelineno-14-23" name="__codelineno-14-23" href="#__codelineno-14-23"></a><span class="w"> </span><span class="nt">"notice"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span>
|
||||
</span><span id="__span-14-24"><a id="__codelineno-14-24" name="__codelineno-14-24" href="#__codelineno-14-24"></a><span class="w"> </span><span class="nt">"qr"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span>
|
||||
</span><span id="__span-14-25"><a id="__codelineno-14-25" name="__codelineno-14-25" href="#__codelineno-14-25"></a><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-14-26"><a id="__codelineno-14-26" name="__codelineno-14-26" href="#__codelineno-14-26"></a><span class="w"> </span><span class="p">]</span>
|
||||
</span><span id="__span-14-27"><a id="__codelineno-14-27" name="__codelineno-14-27" href="#__codelineno-14-27"></a><span class="p">}</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -4509,10 +4567,10 @@ an HTTP caller would be remote code execution. You configure post-scripts only i
|
||||
</div>
|
||||
</div>
|
||||
<h3 id="post-apidownloadjobsjob_idretry"><code>POST /api/download/jobs/{job_id}/retry</code><a class="headerlink" href="#post-apidownloadjobsjob_idretry" title="Permanent link">¶</a></h3>
|
||||
<p>Enqueue a <strong>new</strong> job that reuses a terminal job's service, title, and parameters. The service allowlist and parameter gates are re-checked. Returns <code>202</code> with the new job's ID.</p>
|
||||
<p>Enqueue a <strong>new</strong> job from the request that made a terminal job. The request goes through the same checks as a new submission: the service allowlist, the parameter checks and the download gates. A parameter that the request did not send takes the server default of the time of the retry. Returns <code>202</code> with the new job's ID.</p>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Retry reuses the original, unredacted parameters</p>
|
||||
<p>A retry replays the finished job's stored parameters exactly as the original client submitted them, including any secrets such as <code>credential</code>/<code>credentials</code>. It does not use the redacted <code>parameters</code> view that <code>GET /api/download/jobs</code> and <code>GET /api/history</code> give. This is deliberate: it lets a retried job reproduce a credentialed download that the redacted job record alone never could. The API masks those credentials everywhere else. But anyone who can retry a job can operate it again with the original credentials.</p>
|
||||
<p>A retry sends again the parameters that the original client submitted, including any secrets such as <code>credential</code>/<code>credentials</code>. It does not use the redacted <code>parameters</code> view that <code>GET /api/download/jobs</code> and <code>GET /api/history</code> give. This is deliberate: it lets a retried job reproduce a credentialed download that the redacted job record alone never could. The API masks those credentials everywhere else. But anyone who can retry a job can operate it again with the original credentials.</p>
|
||||
</div>
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="11:1"><input checked="checked" id="__tabbed_11_1" name="__tabbed_11" type="radio" /><div class="tabbed-labels"><label for="__tabbed_11_1">Response <code>202</code></label></div>
|
||||
<div class="tabbed-content">
|
||||
@@ -4556,6 +4614,11 @@ an HTTP caller would be remote code execution. You configure post-scripts only i
|
||||
<td>Service is no longer allowed.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>400</code></td>
|
||||
<td><code>INVALID_PARAMETERS</code></td>
|
||||
<td>A parameter no longer passes the checks, for example an <code>output_dir</code> outside a moved downloads directory.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>403</code></td>
|
||||
<td><code>FORBIDDEN</code></td>
|
||||
<td>A gated parameter is no longer permitted.</td>
|
||||
@@ -4610,7 +4673,8 @@ example an OTP code, a PIN, or a device-code confirmation. The job then shows th
|
||||
answer here.</p>
|
||||
<p>A job that waits for an approval on another device, such as a pair code login, shows the
|
||||
message in its <code>notice</code> field instead. A notice needs no answer: show it to the user and keep
|
||||
polling.</p>
|
||||
polling. When the login is a QR code to scan, the job also sets <code>qr</code> to the text of the code:
|
||||
draw it as a QR code beside the prompt or notice.</p>
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="13:2"><input checked="checked" id="__tabbed_13_1" name="__tabbed_13" type="radio" /><input id="__tabbed_13_2" name="__tabbed_13" type="radio" /><div class="tabbed-labels"><label for="__tabbed_13_1">Request</label><label for="__tabbed_13_2">Response <code>200</code></label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
@@ -4747,12 +4811,13 @@ answers the prompt within 10 minutes.</p>
|
||||
</span><span id="__span-26-9"><a id="__codelineno-26-9" name="__codelineno-26-9" href="#__codelineno-26-9"></a><span class="w"> </span><span class="nt">"created_time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2026-07-03T12:00:00+00:00"</span><span class="p">,</span>
|
||||
</span><span id="__span-26-10"><a id="__codelineno-26-10" name="__codelineno-26-10" href="#__codelineno-26-10"></a><span class="w"> </span><span class="nt">"completed_time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2026-07-03T12:08:00+00:00"</span><span class="p">,</span>
|
||||
</span><span id="__span-26-11"><a id="__codelineno-26-11" name="__codelineno-26-11" href="#__codelineno-26-11"></a><span class="w"> </span><span class="nt">"output_files"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"/downloads/Example.S01E01.mkv"</span><span class="p">],</span>
|
||||
</span><span id="__span-26-12"><a id="__codelineno-26-12" name="__codelineno-26-12" href="#__codelineno-26-12"></a><span class="w"> </span><span class="nt">"error_message"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span>
|
||||
</span><span id="__span-26-13"><a id="__codelineno-26-13" name="__codelineno-26-13" href="#__codelineno-26-13"></a><span class="w"> </span><span class="nt">"parameters"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">"..."</span><span class="p">:</span><span class="w"> </span><span class="s2">"redacted"</span><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-26-14"><a id="__codelineno-26-14" name="__codelineno-26-14" href="#__codelineno-26-14"></a><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-26-15"><a id="__codelineno-26-15" name="__codelineno-26-15" href="#__codelineno-26-15"></a><span class="w"> </span><span class="p">],</span>
|
||||
</span><span id="__span-26-16"><a id="__codelineno-26-16" name="__codelineno-26-16" href="#__codelineno-26-16"></a><span class="w"> </span><span class="nt">"count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span>
|
||||
</span><span id="__span-26-17"><a id="__codelineno-26-17" name="__codelineno-26-17" href="#__codelineno-26-17"></a><span class="p">}</span>
|
||||
</span><span id="__span-26-12"><a id="__codelineno-26-12" name="__codelineno-26-12" href="#__codelineno-26-12"></a><span class="w"> </span><span class="nt">"skipped_titles"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span>
|
||||
</span><span id="__span-26-13"><a id="__codelineno-26-13" name="__codelineno-26-13" href="#__codelineno-26-13"></a><span class="w"> </span><span class="nt">"error_message"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span>
|
||||
</span><span id="__span-26-14"><a id="__codelineno-26-14" name="__codelineno-26-14" href="#__codelineno-26-14"></a><span class="w"> </span><span class="nt">"parameters"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">"..."</span><span class="p">:</span><span class="w"> </span><span class="s2">"redacted"</span><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-26-15"><a id="__codelineno-26-15" name="__codelineno-26-15" href="#__codelineno-26-15"></a><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-26-16"><a id="__codelineno-26-16" name="__codelineno-26-16" href="#__codelineno-26-16"></a><span class="w"> </span><span class="p">],</span>
|
||||
</span><span id="__span-26-17"><a id="__codelineno-26-17" name="__codelineno-26-17" href="#__codelineno-26-17"></a><span class="w"> </span><span class="nt">"count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span>
|
||||
</span><span id="__span-26-18"><a id="__codelineno-26-18" name="__codelineno-26-18" href="#__codelineno-26-18"></a><span class="p">}</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -4882,15 +4947,17 @@ answers the prompt within 10 minutes.</p>
|
||||
<p>The server holds remote sessions in memory. They expire after <code>serve.session_ttl</code> (default 300s) without a request, except while awaiting interactive authentication input, which uses a 600s window. A remote session binds to the IP that made it, so the server rejects a request from a different IP with <code>403 FORBIDDEN</code>.</p>
|
||||
<h3 id="remote-session-lifecycle-overview">Remote session lifecycle overview<a class="headerlink" href="#remote-session-lifecycle-overview" title="Permanent link">¶</a></h3>
|
||||
<div class="language-text highlight"><pre><span></span><code><span id="__span-30-1"><a id="__codelineno-30-1" name="__codelineno-30-1" href="#__codelineno-30-1"></a>POST /api/session/create → returns session_id, status "authenticating"
|
||||
</span><span id="__span-30-2"><a id="__codelineno-30-2" name="__codelineno-30-2" href="#__codelineno-30-2"></a>GET /api/session/{id}/prompt → poll until authenticated (submit answers via POST)
|
||||
</span><span id="__span-30-3"><a id="__codelineno-30-3" name="__codelineno-30-3" href="#__codelineno-30-3"></a>GET /api/session/{id}/titles → list titles
|
||||
</span><span id="__span-30-4"><a id="__codelineno-30-4" name="__codelineno-30-4" href="#__codelineno-30-4"></a>POST /api/session/{id}/tracks → tracks + chapters (with URLs) for one title
|
||||
</span><span id="__span-30-5"><a id="__codelineno-30-5" name="__codelineno-30-5" href="#__codelineno-30-5"></a>POST /api/session/{id}/segments → resolve segment URLs / DRM / headers per track
|
||||
</span><span id="__span-30-6"><a id="__codelineno-30-6" name="__codelineno-30-6" href="#__codelineno-30-6"></a>POST /api/session/{id}/segment_filter → HLS segments the service drops (ads, bumpers)
|
||||
</span><span id="__span-30-7"><a id="__codelineno-30-7" name="__codelineno-30-7" href="#__codelineno-30-7"></a>POST /api/session/{id}/samples → decrypt cbcs samples of a track on the server
|
||||
</span><span id="__span-30-8"><a id="__codelineno-30-8" name="__codelineno-30-8" href="#__codelineno-30-8"></a>POST /api/session/{id}/license → proxy or server-CDM DRM licensing
|
||||
</span><span id="__span-30-9"><a id="__codelineno-30-9" name="__codelineno-30-9" href="#__codelineno-30-9"></a>POST /api/session/{id}/keys/bad → report a server-vault content key that did not decrypt
|
||||
</span><span id="__span-30-10"><a id="__codelineno-30-10" name="__codelineno-30-10" href="#__codelineno-30-10"></a>DELETE /api/session/{id} → tear down, harvest updated cache
|
||||
</span><span id="__span-30-2"><a id="__codelineno-30-2" name="__codelineno-30-2" href="#__codelineno-30-2"></a>GET /api/session/{id}/channel → WebSocket: prompts, CDM calls, logs, login state, drain
|
||||
</span><span id="__span-30-3"><a id="__codelineno-30-3" name="__codelineno-30-3" href="#__codelineno-30-3"></a>GET /api/session/{id}/prompt → without the channel: poll until authenticated (submit answers via POST)
|
||||
</span><span id="__span-30-4"><a id="__codelineno-30-4" name="__codelineno-30-4" href="#__codelineno-30-4"></a>GET /api/session/{id}/titles → list titles
|
||||
</span><span id="__span-30-5"><a id="__codelineno-30-5" name="__codelineno-30-5" href="#__codelineno-30-5"></a>POST /api/session/{id}/tracks → tracks + chapters (with URLs) for one title; a track that resolves its URL on use has resolve_url true and no URL
|
||||
</span><span id="__span-30-6"><a id="__codelineno-30-6" name="__codelineno-30-6" href="#__codelineno-30-6"></a>POST /api/session/{id}/segments → resolve segment URLs / DRM / headers per track
|
||||
</span><span id="__span-30-7"><a id="__codelineno-30-7" name="__codelineno-30-7" href="#__codelineno-30-7"></a>POST /api/session/{id}/segment_filter → HLS segments the service drops (ads, bumpers)
|
||||
</span><span id="__span-30-8"><a id="__codelineno-30-8" name="__codelineno-30-8" href="#__codelineno-30-8"></a>POST /api/session/{id}/samples → decrypt cbcs samples of a track on the server
|
||||
</span><span id="__span-30-9"><a id="__codelineno-30-9" name="__codelineno-30-9" href="#__codelineno-30-9"></a>POST /api/session/{id}/license → proxy or server-CDM DRM licensing
|
||||
</span><span id="__span-30-10"><a id="__codelineno-30-10" name="__codelineno-30-10" href="#__codelineno-30-10"></a>POST /api/session/{id}/keys → store the content keys the client proved on a track
|
||||
</span><span id="__span-30-11"><a id="__codelineno-30-11" name="__codelineno-30-11" href="#__codelineno-30-11"></a>POST /api/session/{id}/keys/bad → report a server-vault content key that did not decrypt
|
||||
</span><span id="__span-30-12"><a id="__codelineno-30-12" name="__codelineno-30-12" href="#__codelineno-30-12"></a>DELETE /api/session/{id} → tear down, harvest updated cache
|
||||
</span></code></pre></div>
|
||||
<h3 id="slow-responses">Slow responses<a class="headerlink" href="#slow-responses" title="Permanent link">¶</a></h3>
|
||||
<p>The <code>titles</code>, <code>tracks</code> and <code>license</code> routes can take minutes on a large catalogue. When the
|
||||
@@ -4951,8 +5018,36 @@ the newlines must go out at once.</p>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="get-apisessionsession_idchannel"><code>GET /api/session/{session_id}/channel</code><a class="headerlink" href="#get-apisessionsession_idchannel" title="Permanent link">¶</a></h3>
|
||||
<p>Open the remote session channel: a WebSocket that carries the prompts, CDM calls, log records, login state and drain state of the remote session, and the client's answers. Pass <code>since=<seq></code> to get only the log records newer than that sequence number. The server closes the WebSocket with code <code>4404</code> when the remote session ends. See <a href="../remote-sessions/#the-remote-session-channel">The remote session channel</a> for the messages.</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Status</th>
|
||||
<th>Error code</th>
|
||||
<th>Meaning</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>101</code></td>
|
||||
<td>-</td>
|
||||
<td>WebSocket open.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>403</code></td>
|
||||
<td><code>FORBIDDEN</code></td>
|
||||
<td>Request IP differs from the remote session creator.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>404</code></td>
|
||||
<td><code>SESSION_NOT_FOUND</code></td>
|
||||
<td>No such session.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="get-apisessionsession_idprompt"><code>GET /api/session/{session_id}/prompt</code><a class="headerlink" href="#get-apisessionsession_idprompt" title="Permanent link">¶</a></h3>
|
||||
<p>Poll for the authentication status and any pending interactive prompt (OTP, PIN, device code). Response variants:</p>
|
||||
<p>The polling fallback of the remote session channel. Poll for the authentication status and any pending interactive prompt (OTP, PIN, device code). Response variants:</p>
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="21:4"><input checked="checked" id="__tabbed_21_1" name="__tabbed_21" type="radio" /><input id="__tabbed_21_2" name="__tabbed_21" type="radio" /><input id="__tabbed_21_3" name="__tabbed_21" type="radio" /><input id="__tabbed_21_4" name="__tabbed_21" type="radio" /><div class="tabbed-labels"><label for="__tabbed_21_1">Authenticating</label><label for="__tabbed_21_2">Pending input</label><label for="__tabbed_21_3">Authenticated</label><label for="__tabbed_21_4">Failed</label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
@@ -5036,7 +5131,7 @@ the newlines must go out at once.</p>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="get-apisessionsession_idlogs"><code>GET /api/session/{session_id}/logs</code><a class="headerlink" href="#get-apisessionsession_idlogs" title="Permanent link">¶</a></h3>
|
||||
<p>Drain the service's server-side log output for this remote session. The server mirrors every log call the service makes (<code>self.log.info</code>, warnings, errors) into a bounded per-session buffer, so a remote client can see why an auth, title, or license step failed. Pass <code>since=<seq></code> to get only records newer than the last drained sequence number. Works in every auth state, including <code>failed</code>.</p>
|
||||
<p>The polling fallback of the remote session channel. Drain the service's server-side log output for this remote session. The server mirrors every log call the service makes (<code>self.log.info</code>, warnings, errors) into a bounded per-session buffer, so a remote client can see why an auth, title, or license step failed. Pass <code>since=<seq></code> to get only records newer than the last drained sequence number. Works in every auth state, including <code>failed</code>.</p>
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="23:1"><input checked="checked" id="__tabbed_23_1" name="__tabbed_23" type="radio" /><div class="tabbed-labels"><label for="__tabbed_23_1">Response <code>200</code></label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
@@ -5320,7 +5415,7 @@ A slow answer arrives as a <a href="#slow-responses">slow response</a>.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>drm_type</code></td>
|
||||
<td><code>widevine</code> (default) or <code>playready</code>. In server-CDM mode the server's <code>cdm</code> mapping for the service decides the DRM system and the response <code>drm_type</code> names the system that licensed. The client's value decides only when the server has no mapping for the service.</td>
|
||||
<td><code>widevine</code> (default) or <code>playready</code>. In server-CDM mode the server's <code>cdm</code> mapping for the service decides the DRM system and the response <code>drm_type</code> names the system that licensed. The client's value decides only when the server has no mapping for the service. A track whose DRM is a whole-file cipher takes <code>clearkeyctr</code> with no <code>pssh</code>: the service on the server licenses it.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>mode</code></td>
|
||||
@@ -5331,6 +5426,10 @@ A slow answer arrives as a <a href="#slow-responses">slow response</a>.</p>
|
||||
<td>Requested track ids that carry no DRM, so they have no keys. Absent when every requested track is encrypted.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>file_keys</code> (response)</td>
|
||||
<td>Content keys of whole-file ciphers, by track id, for a single track and for a batch. Absent when no requested track holds such a cipher.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>vault_keys</code> (response)</td>
|
||||
<td>KIDs whose content key came from a server vault, not the CDM. The client proves such a content key with a decode before it trusts it; the field is absent when every content key came from the CDM.</td>
|
||||
</tr>
|
||||
@@ -5377,9 +5476,34 @@ A slow answer arrives as a <a href="#slow-responses">slow response</a>.</p>
|
||||
</tr>
|
||||
</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>
|
||||
<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>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Status</th>
|
||||
<th>Error code</th>
|
||||
<th>Meaning</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>200</code></td>
|
||||
<td>-</td>
|
||||
<td><code>{}</code>, whatever the server stored.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>404</code></td>
|
||||
<td><code>SESSION_NOT_FOUND</code></td>
|
||||
<td>Unknown remote session.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="post-apisessionsession_idkeysbad"><code>POST /api/session/{session_id}/keys/bad</code><a class="headerlink" href="#post-apisessionsession_idkeysbad" title="Permanent link">¶</a></h3>
|
||||
<p>Report a content key from <code>vault_keys</code> that did not decrypt the track. The server flags the pair in its local vaults and reports it to the vault that served it, and the next licence for that KID reaches the CDM. When the CDM returns the same pair, the server removes the flag. The client never learns the server vault names.</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">"kid"</span><span class="p">:</span><span class="w"> </span><span class="s2">"<kid_hex>"</span><span class="p">,</span><span class="w"> </span><span class="nt">"key"</span><span class="p">:</span><span class="w"> </span><span class="s2">"<key_hex>"</span><span class="w"> </span><span class="p">}</span>
|
||||
<div class="language-json highlight"><pre><span></span><code><span id="__span-47-1"><a id="__codelineno-47-1" name="__codelineno-47-1" href="#__codelineno-47-1"></a><span class="p">{</span><span class="w"> </span><span class="nt">"kid"</span><span class="p">:</span><span class="w"> </span><span class="s2">"<kid_hex>"</span><span class="p">,</span><span class="w"> </span><span class="nt">"key"</span><span class="p">:</span><span class="w"> </span><span class="s2">"<key_hex>"</span><span class="w"> </span><span class="p">}</span>
|
||||
</span></code></pre></div>
|
||||
<table>
|
||||
<thead>
|
||||
@@ -5412,15 +5536,15 @@ A slow answer arrives as a <a href="#slow-responses">slow response</a>.</p>
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="30:1"><input checked="checked" id="__tabbed_30_1" name="__tabbed_30" type="radio" /><div class="tabbed-labels"><label for="__tabbed_30_1">Response <code>200</code></label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
<div class="language-json highlight"><pre><span></span><code><span id="__span-47-1"><a id="__codelineno-47-1" name="__codelineno-47-1" href="#__codelineno-47-1"></a><span class="p">{</span>
|
||||
</span><span id="__span-47-2"><a id="__codelineno-47-2" name="__codelineno-47-2" href="#__codelineno-47-2"></a><span class="w"> </span><span class="nt">"session_id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"d4e5f6a7-..."</span><span class="p">,</span>
|
||||
</span><span id="__span-47-3"><a id="__codelineno-47-3" name="__codelineno-47-3" href="#__codelineno-47-3"></a><span class="w"> </span><span class="nt">"service"</span><span class="p">:</span><span class="w"> </span><span class="s2">"EXAMPLE"</span><span class="p">,</span>
|
||||
</span><span id="__span-47-4"><a id="__codelineno-47-4" name="__codelineno-47-4" href="#__codelineno-47-4"></a><span class="w"> </span><span class="nt">"valid"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
||||
</span><span id="__span-47-5"><a id="__codelineno-47-5" name="__codelineno-47-5" href="#__codelineno-47-5"></a><span class="w"> </span><span class="nt">"expires_in"</span><span class="p">:</span><span class="w"> </span><span class="mi">300</span><span class="p">,</span>
|
||||
</span><span id="__span-47-6"><a id="__codelineno-47-6" name="__codelineno-47-6" href="#__codelineno-47-6"></a><span class="w"> </span><span class="nt">"draining"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span>
|
||||
</span><span id="__span-47-7"><a id="__codelineno-47-7" name="__codelineno-47-7" href="#__codelineno-47-7"></a><span class="w"> </span><span class="nt">"track_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span>
|
||||
</span><span id="__span-47-8"><a id="__codelineno-47-8" name="__codelineno-47-8" href="#__codelineno-47-8"></a><span class="w"> </span><span class="nt">"title_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span>
|
||||
</span><span id="__span-47-9"><a id="__codelineno-47-9" name="__codelineno-47-9" href="#__codelineno-47-9"></a><span class="p">}</span>
|
||||
<div class="language-json highlight"><pre><span></span><code><span id="__span-48-1"><a id="__codelineno-48-1" name="__codelineno-48-1" href="#__codelineno-48-1"></a><span class="p">{</span>
|
||||
</span><span id="__span-48-2"><a id="__codelineno-48-2" name="__codelineno-48-2" href="#__codelineno-48-2"></a><span class="w"> </span><span class="nt">"session_id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"d4e5f6a7-..."</span><span class="p">,</span>
|
||||
</span><span id="__span-48-3"><a id="__codelineno-48-3" name="__codelineno-48-3" href="#__codelineno-48-3"></a><span class="w"> </span><span class="nt">"service"</span><span class="p">:</span><span class="w"> </span><span class="s2">"EXAMPLE"</span><span class="p">,</span>
|
||||
</span><span id="__span-48-4"><a id="__codelineno-48-4" name="__codelineno-48-4" href="#__codelineno-48-4"></a><span class="w"> </span><span class="nt">"valid"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
||||
</span><span id="__span-48-5"><a id="__codelineno-48-5" name="__codelineno-48-5" href="#__codelineno-48-5"></a><span class="w"> </span><span class="nt">"expires_in"</span><span class="p">:</span><span class="w"> </span><span class="mi">300</span><span class="p">,</span>
|
||||
</span><span id="__span-48-6"><a id="__codelineno-48-6" name="__codelineno-48-6" href="#__codelineno-48-6"></a><span class="w"> </span><span class="nt">"draining"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span>
|
||||
</span><span id="__span-48-7"><a id="__codelineno-48-7" name="__codelineno-48-7" href="#__codelineno-48-7"></a><span class="w"> </span><span class="nt">"track_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span>
|
||||
</span><span id="__span-48-8"><a id="__codelineno-48-8" name="__codelineno-48-8" href="#__codelineno-48-8"></a><span class="w"> </span><span class="nt">"title_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span>
|
||||
</span><span id="__span-48-9"><a id="__codelineno-48-9" name="__codelineno-48-9" href="#__codelineno-48-9"></a><span class="p">}</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -5431,10 +5555,10 @@ A slow answer arrives as a <a href="#slow-responses">slow response</a>.</p>
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="31:1"><input checked="checked" id="__tabbed_31_1" name="__tabbed_31" type="radio" /><div class="tabbed-labels"><label for="__tabbed_31_1">Response <code>200</code></label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
<div class="language-json highlight"><pre><span></span><code><span id="__span-48-1"><a id="__codelineno-48-1" name="__codelineno-48-1" href="#__codelineno-48-1"></a><span class="p">{</span>
|
||||
</span><span id="__span-48-2"><a id="__codelineno-48-2" name="__codelineno-48-2" href="#__codelineno-48-2"></a><span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ok"</span><span class="p">,</span>
|
||||
</span><span id="__span-48-3"><a id="__codelineno-48-3" name="__codelineno-48-3" href="#__codelineno-48-3"></a><span class="w"> </span><span class="nt">"cache"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">"tokens"</span><span class="p">:</span><span class="w"> </span><span class="s2">"<base64 zlib bytes>"</span><span class="p">,</span><span class="w"> </span><span class="nt">"session_web/<sha1>"</span><span class="p">:</span><span class="w"> </span><span class="s2">"<base64 zlib bytes>"</span><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-48-4"><a id="__codelineno-48-4" name="__codelineno-48-4" href="#__codelineno-48-4"></a><span class="p">}</span>
|
||||
<div class="language-json highlight"><pre><span></span><code><span id="__span-49-1"><a id="__codelineno-49-1" name="__codelineno-49-1" href="#__codelineno-49-1"></a><span class="p">{</span>
|
||||
</span><span id="__span-49-2"><a id="__codelineno-49-2" name="__codelineno-49-2" href="#__codelineno-49-2"></a><span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ok"</span><span class="p">,</span>
|
||||
</span><span id="__span-49-3"><a id="__codelineno-49-3" name="__codelineno-49-3" href="#__codelineno-49-3"></a><span class="w"> </span><span class="nt">"cache"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">"tokens"</span><span class="p">:</span><span class="w"> </span><span class="s2">"<base64 zlib bytes>"</span><span class="p">,</span><span class="w"> </span><span class="nt">"session_web/<sha1>"</span><span class="p">:</span><span class="w"> </span><span class="s2">"<base64 zlib bytes>"</span><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-49-4"><a id="__codelineno-49-4" name="__codelineno-49-4" href="#__codelineno-49-4"></a><span class="p">}</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -5443,15 +5567,15 @@ A slow answer arrives as a <a href="#slow-responses">slow response</a>.</p>
|
||||
<hr />
|
||||
<h2 id="error-responses">Error responses<a class="headerlink" href="#error-responses" title="Permanent link">¶</a></h2>
|
||||
<p>The server serialises every structured error raised inside a handler to the same JSON envelope:</p>
|
||||
<div class="language-json highlight"><pre><span></span><code><span id="__span-49-1"><a id="__codelineno-49-1" name="__codelineno-49-1" href="#__codelineno-49-1"></a><span class="p">{</span>
|
||||
</span><span id="__span-49-2"><a id="__codelineno-49-2" name="__codelineno-49-2" href="#__codelineno-49-2"></a><span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"error"</span><span class="p">,</span>
|
||||
</span><span id="__span-49-3"><a id="__codelineno-49-3" name="__codelineno-49-3" href="#__codelineno-49-3"></a><span class="w"> </span><span class="nt">"error_code"</span><span class="p">:</span><span class="w"> </span><span class="s2">"INVALID_PARAMETERS"</span><span class="p">,</span>
|
||||
</span><span id="__span-49-4"><a id="__codelineno-49-4" name="__codelineno-49-4" href="#__codelineno-49-4"></a><span class="w"> </span><span class="nt">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Invalid video codec: XYZ"</span><span class="p">,</span>
|
||||
</span><span id="__span-49-5"><a id="__codelineno-49-5" name="__codelineno-49-5" href="#__codelineno-49-5"></a><span class="w"> </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2026-07-03T12:00:00+00:00"</span><span class="p">,</span>
|
||||
</span><span id="__span-49-6"><a id="__codelineno-49-6" name="__codelineno-49-6" href="#__codelineno-49-6"></a><span class="w"> </span><span class="nt">"details"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">"field"</span><span class="p">:</span><span class="w"> </span><span class="s2">"vcodec"</span><span class="w"> </span><span class="p">},</span>
|
||||
</span><span id="__span-49-7"><a id="__codelineno-49-7" name="__codelineno-49-7" href="#__codelineno-49-7"></a><span class="w"> </span><span class="nt">"retryable"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
||||
</span><span id="__span-49-8"><a id="__codelineno-49-8" name="__codelineno-49-8" href="#__codelineno-49-8"></a><span class="w"> </span><span class="nt">"debug_info"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">"exception_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"APIError"</span><span class="p">,</span><span class="w"> </span><span class="nt">"traceback"</span><span class="p">:</span><span class="w"> </span><span class="s2">"..."</span><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-49-9"><a id="__codelineno-49-9" name="__codelineno-49-9" href="#__codelineno-49-9"></a><span class="p">}</span>
|
||||
<div class="language-json highlight"><pre><span></span><code><span id="__span-50-1"><a id="__codelineno-50-1" name="__codelineno-50-1" href="#__codelineno-50-1"></a><span class="p">{</span>
|
||||
</span><span id="__span-50-2"><a id="__codelineno-50-2" name="__codelineno-50-2" href="#__codelineno-50-2"></a><span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"error"</span><span class="p">,</span>
|
||||
</span><span id="__span-50-3"><a id="__codelineno-50-3" name="__codelineno-50-3" href="#__codelineno-50-3"></a><span class="w"> </span><span class="nt">"error_code"</span><span class="p">:</span><span class="w"> </span><span class="s2">"INVALID_PARAMETERS"</span><span class="p">,</span>
|
||||
</span><span id="__span-50-4"><a id="__codelineno-50-4" name="__codelineno-50-4" href="#__codelineno-50-4"></a><span class="w"> </span><span class="nt">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Invalid video codec: XYZ"</span><span class="p">,</span>
|
||||
</span><span id="__span-50-5"><a id="__codelineno-50-5" name="__codelineno-50-5" href="#__codelineno-50-5"></a><span class="w"> </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2026-07-03T12:00:00+00:00"</span><span class="p">,</span>
|
||||
</span><span id="__span-50-6"><a id="__codelineno-50-6" name="__codelineno-50-6" href="#__codelineno-50-6"></a><span class="w"> </span><span class="nt">"details"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">"field"</span><span class="p">:</span><span class="w"> </span><span class="s2">"vcodec"</span><span class="w"> </span><span class="p">},</span>
|
||||
</span><span id="__span-50-7"><a id="__codelineno-50-7" name="__codelineno-50-7" href="#__codelineno-50-7"></a><span class="w"> </span><span class="nt">"retryable"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
||||
</span><span id="__span-50-8"><a id="__codelineno-50-8" name="__codelineno-50-8" href="#__codelineno-50-8"></a><span class="w"> </span><span class="nt">"debug_info"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">"exception_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"APIError"</span><span class="p">,</span><span class="w"> </span><span class="nt">"traceback"</span><span class="p">:</span><span class="w"> </span><span class="s2">"..."</span><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-50-9"><a id="__codelineno-50-9" name="__codelineno-50-9" href="#__codelineno-50-9"></a><span class="p">}</span>
|
||||
</span></code></pre></div>
|
||||
<ul>
|
||||
<li><code>details</code> appears only when non-empty.</li>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2311,8 +2311,9 @@ reference. Each endpoint lists the specific codes it raises, and this page gives
|
||||
meanings of those codes.</p>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Where this comes from</p>
|
||||
<p><code>unshackle/core/api/errors.py</code> defines the error format, and the wrapper
|
||||
that turns raised errors into responses lives in <code>unshackle/core/api/routes.py</code>.
|
||||
<p><code>unshackle/core/api/errors.py</code> defines the error format, <code>unshackle/core/remote_protocol.py</code>
|
||||
defines the error codes, and the wrapper that turns raised errors into responses lives in
|
||||
<code>unshackle/core/api/routes.py</code>.
|
||||
Nothing on this page is invented. It reflects the actual server behaviour.</p>
|
||||
</div>
|
||||
<h2 id="the-standard-error-shape">The standard error shape<a class="headerlink" href="#the-standard-error-shape" title="Permanent link">¶</a></h2>
|
||||
@@ -2604,9 +2605,15 @@ For example, a missing <code>service</code> field yields <code>INVALID_INPUT</co
|
||||
service yields <code>INVALID_SERVICE</code>. These carry a precise code, message, and often a
|
||||
populated <code>details</code> object.</p>
|
||||
<p><strong>Categorised exceptions.</strong> When an endpoint calls into a streaming service and an
|
||||
uncategorised exception bubbles up, the server runs it through a classifier that
|
||||
inspects the exception type and message and maps it to the most appropriate code.
|
||||
The classification is keyword-based, checked in order:</p>
|
||||
exception that is not an <code>APIError</code> bubbles up, the server gives it a code in two steps:</p>
|
||||
<ol>
|
||||
<li><strong>The code the failure names.</strong> An unshackle core failure states its own code: a region
|
||||
check gives <code>GEOFENCE</code>, a proxy that fails gives <code>INVALID_PROXY</code>, a login that needs
|
||||
an absent user gives <code>AUTH_FAILED</code>, and a DRM failure gives <code>DRM_ERROR</code>. The server
|
||||
reads this code first, so the wording of the message does not change it.</li>
|
||||
<li><strong>The keywords of the message.</strong> A failure that names no code, such as the plain text
|
||||
that a service raises, gets a code from the words in its message, checked in order:</li>
|
||||
</ol>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -2617,6 +2624,16 @@ The classification is keyword-based, checked in order:</p>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>geofence</code>, <code>geoblock</code>, <code>geo-block</code>, <code>geolocation</code>, <code>region</code>, <code>not available in</code>, <code>territory</code></td>
|
||||
<td><code>GEOFENCE</code> (403)</td>
|
||||
<td>no</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>proxy</code></td>
|
||||
<td><code>INVALID_PROXY</code> (400)</td>
|
||||
<td>no</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>auth</code>, <code>login</code>, <code>credential</code>, <code>unauthorized</code>, <code>forbidden</code>, <code>token</code></td>
|
||||
<td><code>AUTH_FAILED</code> (401)</td>
|
||||
<td>no</td>
|
||||
@@ -2627,11 +2644,6 @@ The classification is keyword-based, checked in order:</p>
|
||||
<td>yes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>geofence</code>, <code>geoblock</code>, <code>region</code>, <code>not available in</code>, <code>territory</code></td>
|
||||
<td><code>GEOFENCE</code> (403)</td>
|
||||
<td>no</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>not found</code>, <code>404</code>, <code>does not exist</code>, <code>invalid id</code></td>
|
||||
<td><code>NOT_FOUND</code> (404)</td>
|
||||
<td>no</td>
|
||||
|
||||
+11
-1
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2494,11 +2494,21 @@ request and response in full.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>POST</code></td>
|
||||
<td><code>/api/session/{session_id}/keys</code></td>
|
||||
<td>Store the content keys the client proved on a track.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>POST</code></td>
|
||||
<td><code>/api/session/{session_id}/keys/bad</code></td>
|
||||
<td>Report a server-vault content key that did not decrypt.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>GET</code></td>
|
||||
<td><code>/api/session/{session_id}/channel</code></td>
|
||||
<td>WebSocket of the remote session channel: prompts, CDM calls, logs, login state.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>GET</code></td>
|
||||
<td><code>/api/session/{session_id}/logs</code></td>
|
||||
<td>Drain the service's server-side log output.</td>
|
||||
</tr>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2685,6 +2685,11 @@ full detail:</p>
|
||||
<td>Subtitles that were skipped as non-fatal failures (when <code>skip_subtitle_errors</code> is set).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>skipped_titles</code></td>
|
||||
<td>list</td>
|
||||
<td>Titles that the run skipped because a requested track or language is missing, each <code>{title, reason}</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>input_prompt</code></td>
|
||||
<td>string or <code>null</code></td>
|
||||
<td>The prompt the service waits on. Answer it with <code>POST /api/download/jobs/{job_id}/input</code>.</td>
|
||||
@@ -2694,6 +2699,11 @@ full detail:</p>
|
||||
<td>string or <code>null</code></td>
|
||||
<td>A message the service shows while it waits for an approval on another device, such as a pair code. It needs no answer.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>qr</code></td>
|
||||
<td>string or <code>null</code></td>
|
||||
<td>The text of a QR code that goes with <code>input_prompt</code> or <code>notice</code>, such as a login URL to scan with a phone. Draw it as a QR code.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>The full detail adds <code>started_time</code>, <code>completed_time</code>, <code>output_files</code>, the redacted
|
||||
@@ -2804,9 +2814,13 @@ ID with <code>202</code>.</p>
|
||||
<li>You can retry only terminal jobs. A retry of a <code>queued</code> or <code>downloading</code> job returns
|
||||
<code>409</code> with error code <code>CONFLICT</code>.</li>
|
||||
<li>A missing job returns <code>404</code> (<code>JOB_NOT_FOUND</code>).</li>
|
||||
<li>The server examines the service allowlist and any download gates again for the new
|
||||
job, exactly as for the original submission. Thus the server can reject a retry with
|
||||
<code>INVALID_SERVICE</code> or <code>FORBIDDEN</code> if permissions changed.</li>
|
||||
<li>The server sends the original request through the same checks as a new submission:
|
||||
the service allowlist, the parameter checks and the download gates. A retry that no
|
||||
longer passes gets the same error as a new submission, for example
|
||||
<code>INVALID_SERVICE</code>, <code>INVALID_PARAMETERS</code> or <code>FORBIDDEN</code> after a config change.</li>
|
||||
<li>Each parameter that the original request did not send takes the server default of
|
||||
the time of the retry, from <code>serve:</code> and <code>services.<TAG>.dl</code>. A job for a
|
||||
<code>remote</code> server takes no local service defaults.</li>
|
||||
</ul>
|
||||
<div class="language-json highlight"><span class="filename">202 Accepted, a fresh job</span><pre><span></span><code><span id="__span-6-1"><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a><span class="p">{</span>
|
||||
</span><span id="__span-6-2"><a id="__codelineno-6-2" name="__codelineno-6-2" href="#__codelineno-6-2"></a><span class="w"> </span><span class="nt">"job_id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"c2f7d8ef-7e1b-5a3a-ae2f-4b3c5d6e7f80"</span><span class="p">,</span>
|
||||
@@ -2900,7 +2914,8 @@ server process. For each job it spawns a separate Python subprocess:</p>
|
||||
the prompt to <code>progress.json</code> as <code>input_prompt</code> and waits. The answer from
|
||||
<code>POST /api/download/jobs/{job_id}/input</code> goes to the job worker on its stdin.
|
||||
When a service waits for an approval on another device, the job worker writes the message as
|
||||
<code>notice</code> and sets it back to <code>null</code> when the wait ends.</p>
|
||||
<code>notice</code> and sets it back to <code>null</code> when the wait ends. A QR code to scan goes out as <code>qr</code>, and
|
||||
the end of its prompt or notice sets it back to <code>null</code>.</p>
|
||||
<p>Running each download out-of-process isolates the server from crashes, memory growth,
|
||||
and blocking work inside the download engine, and makes hard cancellation (killing the
|
||||
process) reliable.</p>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2516,7 +2516,7 @@
|
||||
<tr>
|
||||
<td><code>range</code></td>
|
||||
<td><code>["SDR"]</code></td>
|
||||
<td>Dynamic range: <code>SDR</code>, <code>HDR10</code>, <code>HDR10+</code>, <code>DV</code>, <code>HLG</code>, <code>HYBRID</code></td>
|
||||
<td>Dynamic range: <code>SDR</code>, <code>HDR10</code>, <code>HDR10+</code>, <code>VIVID</code>, <code>DV</code>, <code>HLG</code>, <code>HYBRID</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>wanted</code></td>
|
||||
@@ -2545,7 +2545,7 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Validation is strict: invalid codecs, subtitle formats, dynamic-range names, non-positive counts, or mutually exclusive flags (for example both <code>video_only</code> and <code>audio_only</code>) come back as <code>400</code> with error code <code>INVALID_PARAMETERS</code>. See the full reference on the <a href="../endpoints/">download reference page</a> for every accepted field.</p>
|
||||
<p>Validation is strict: invalid codecs, subtitle formats, dynamic-range names, non-positive counts, or flags that conflict (for example both <code>no_subs</code> and <code>subs_only</code>) come back as <code>400</code> with error code <code>INVALID_PARAMETERS</code>. See the full reference on the <a href="../endpoints/">download reference page</a> for every accepted field.</p>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Gated fields</p>
|
||||
<p>The server refuses a per-request CDM (<code>cdm</code>) or inline credentials (<code>credential</code> / <code>credentials</code>) with <code>403 FORBIDDEN</code>, unless the server operator has explicitly opted in with <code>serve.cdm_overrides</code> and <code>serve.allow_job_credentials</code>. Both are off by default.</p>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -1834,6 +1834,17 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#the-remote-session-channel" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
The remote session channel
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -2339,6 +2350,17 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#the-remote-session-channel" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
The remote session channel
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -2608,8 +2630,8 @@ runs in the background on the server.</p>
|
||||
<div class="tabbed-block">
|
||||
<p>Some services need a one-time code, PIN, or device confirmation. When the
|
||||
server's auth flow asks for input, the remote session enters <code>pending_input</code>. The
|
||||
client polls, displays the prompt to you locally, collects your answer, and
|
||||
sends it back. The server's auth thread resumes with your response.</p>
|
||||
server sends the prompt to the client, the client shows it to you locally, collects
|
||||
your answer, and sends it back. The server's auth thread resumes with your response.</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>Enter the 6-digit code sent to your email: 483920
|
||||
</span></code></pre></div>
|
||||
<p>A client older than the <code>service_params</code> change sends service options as
|
||||
@@ -2619,8 +2641,7 @@ profile) no longer reaches the service; the server logs a warning naming
|
||||
the dropped key. Update the client to send service options under
|
||||
<code>service_params</code>.</p>
|
||||
<p>The server also mirrors the service's own log output (<code>self.log</code>) into a
|
||||
per-session buffer. The client drains it through
|
||||
<code>GET /api/session/{id}/logs</code> after each step and prints the records
|
||||
per-session buffer and sends each record to the client, which prints the records
|
||||
locally, so you see the server-side reason when a step fails.</p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
@@ -2649,9 +2670,9 @@ and return the content keys directly. See
|
||||
<a href="#server-side-vs-proxied-cdm">Server-side vs. proxied CDM</a> below.</p>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<p>The client downloads, decrypts, and muxes locally. While it works, it sends a
|
||||
keep-alive request to the remote session at an interval of one third of
|
||||
<code>session_ttl</code>, so a long download does not let the remote session expire. On
|
||||
<p>The client downloads, decrypts, and muxes locally. While it works, the open
|
||||
<a href="#the-remote-session-channel">remote session channel</a> keeps the remote session alive,
|
||||
so a long download does not let the remote session expire. On
|
||||
completion, and also when <code>dl</code> exits early (<code>--list</code>, Ctrl+C, an error), it
|
||||
deletes the remote session. If the login belongs to the client, the <code>DELETE</code>
|
||||
request returns the updated cache files (for example a refreshed token) and the
|
||||
@@ -2695,7 +2716,9 @@ the raw license bytes come back for your local CDM to parse.</p>
|
||||
<code>server_cdm: false</code> when it creates the remote session, and the server builds the
|
||||
service on your device even when the API key has the server CDM.</li>
|
||||
<li>A service option that the service lists in <code>SERVER_DEVICE_OPTIONS</code> keeps the server
|
||||
CDM. The server reads the option from <code>service_params</code>, or from the top level of
|
||||
CDM, and the service gets the server's device whatever device you have. From a server
|
||||
<code>cdm</code> entry with a device for both DRM systems, it gets the device that the entry
|
||||
lists first. The server reads the option from <code>service_params</code>, or from the top level of
|
||||
a request that has no <code>service_params</code>. The create response gives the result in
|
||||
<code>server_cdm</code>, and the client shows a warning when the server did not apply its choice.</li>
|
||||
<li>The service on the server sees your device, not the server's: its DRM system,
|
||||
@@ -2755,8 +2778,9 @@ the wire:</p>
|
||||
<li><strong>CDM calls.</strong> When the service calls the CDM, the server sends a <code>cdm_call</code> to the client
|
||||
and waits. The client makes the challenge, or parses the licence, on its own CDM. When
|
||||
the service closes a CDM session, the server sends a <code>close</code> call, because a CDM holds
|
||||
only a few sessions. The client polls for calls during login and while one of its own
|
||||
requests runs service code, so an idle remote session sends nothing extra.</li>
|
||||
only a few sessions. The server sends each call on the remote session channel. Without
|
||||
the channel, the client polls for calls during login and while one of its own requests
|
||||
runs service code, so an idle remote session sends nothing extra.</li>
|
||||
<li><strong>Session keys only.</strong> A <code>keys</code> call returns Widevine <code>OPERATOR_SESSION</code> and <code>SIGNING</code>
|
||||
keys. It never returns a content key, and the client refuses a PlayReady <code>keys</code> call.
|
||||
So a server cannot use your device to license titles for itself.</li>
|
||||
@@ -2802,12 +2826,12 @@ generally never touch this directly, but it explains behaviour you might observe
|
||||
<tr>
|
||||
<td>Idle session TTL</td>
|
||||
<td><strong>300s</strong> (5 min) default</td>
|
||||
<td>Refreshed on every request to the session and when a <code>titles</code> or <code>tracks</code> request ends. A remote session does not expire while a request works on it</td>
|
||||
<td>Refreshed on every request to the session and when a <code>titles</code> or <code>tracks</code> request ends. A remote session does not expire while a request works on it or while its remote session channel is open</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Max concurrent sessions</td>
|
||||
<td><strong>100</strong> default</td>
|
||||
<td>Oldest (least recently used) is evicted when full. A remote session that a request works on goes last</td>
|
||||
<td>When full, the least recently used remote session of the API key that holds the most is evicted. A remote session that a request works on goes last</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Auth/input timeout</td>
|
||||
@@ -2847,7 +2871,12 @@ mid-prompt.</p>
|
||||
cannot read each other's cached tokens. The server deletes the directory when the
|
||||
remote session ends. A remote session that uses a server account (<code>serve.server_accounts</code>)
|
||||
gets a persistent per-account cache instead, so the account's tokens outlive the
|
||||
remote session. The server and the client both refuse a forwarded cache file that is not
|
||||
remote session. A service can name cache files that hold its device identity in
|
||||
<code>Service.IDENTITY_CACHE</code>. A remote session on the server's device, or of an API key with its
|
||||
own device config, writes those files to a directory of the API key, outside the remote
|
||||
session's directory, so the server never sends them to the client and never takes them from
|
||||
the client, and the next remote session of that
|
||||
API key reads them again. The server and the client both refuse a forwarded cache file that is not
|
||||
JSON or that names a type other than a date or time, and the service then authenticates again.</li>
|
||||
<li><strong>A tunnel belongs to its API key.</strong> The server accepts <code>tunnel:<id></code> only from the API key
|
||||
that opened the tunnel. Its SOCKS5 proxy listens on loopback only, and it needs a username and
|
||||
@@ -2932,23 +2961,33 @@ from a browser origin, not when you want only the local HTTP API.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>POST</code></td>
|
||||
<td><code>/api/session/{id}/keys</code></td>
|
||||
<td>Store the content keys the client proved on a track</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>POST</code></td>
|
||||
<td><code>/api/session/{id}/keys/bad</code></td>
|
||||
<td>Report a server-vault content key that did not decrypt</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>GET</code></td>
|
||||
<td><code>/api/session/{id}/channel</code></td>
|
||||
<td>WebSocket of the <a href="#the-remote-session-channel">remote session channel</a>: the messages the server starts, and the client's answers; <code>?since=</code> is the last log <code>seq</code> the client has</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>GET</code></td>
|
||||
<td><code>/api/session/{id}/logs</code></td>
|
||||
<td>Drain the service's server-side log output</td>
|
||||
<td>Drain the service's server-side log output (polling fallback)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>GET</code></td>
|
||||
<td><code>/api/session/{id}/prompt</code></td>
|
||||
<td>Poll interactive auth status / pending prompt</td>
|
||||
<td>Poll interactive auth status / pending prompt (polling fallback)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>POST</code></td>
|
||||
<td><code>/api/session/{id}/prompt</code></td>
|
||||
<td>Submit an answer to a pending prompt</td>
|
||||
<td>Submit an answer to a pending prompt (polling fallback)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>GET</code></td>
|
||||
@@ -3000,33 +3039,35 @@ a per-profile ESN.</p>
|
||||
licenses. <code>server_device</code> tells it that the service runs on the server's device, so every
|
||||
content key comes from a vault.</p>
|
||||
<p>Authentication runs on a background thread (<code>asyncio.to_thread(authenticate, ...)</code>).
|
||||
The remote session starts in <code>AUTHENTICATING</code>. The client must poll the prompt
|
||||
endpoint until it reaches <code>authenticated</code> (or <code>failed</code>).</p>
|
||||
The remote session starts in <code>AUTHENTICATING</code>. The client opens the remote session
|
||||
channel and waits on it until the login state is <code>authenticated</code> (or <code>failed</code>). A client
|
||||
without the channel polls the prompt endpoint for that state.</p>
|
||||
<h3 id="interactive-auth-the-inputbridge">Interactive auth: the <code>InputBridge</code><a class="headerlink" href="#interactive-auth-the-inputbridge" title="Permanent link">¶</a></h3>
|
||||
<p>When the service calls its input function during <code>authenticate()</code> on the server
|
||||
thread, an <code>InputBridge</code> pauses that thread and exposes the prompt to the HTTP
|
||||
layer.</p>
|
||||
<ul>
|
||||
<li><code>AuthStatus</code> values: <code>authenticating</code>, <code>pending_input</code>, <code>authenticated</code>, <code>failed</code>.</li>
|
||||
<li><code>InputBridge.request_input(prompt, timeout=600)</code> blocks the sync auth thread on a
|
||||
<li><code>InputBridge.request_input(prompt, timeout=600, qr=None)</code> blocks the sync auth thread on a
|
||||
<code>threading.Event</code> until <code>submit_response()</code> or <code>cancel()</code> fires.</li>
|
||||
<li>A timeout raises <code>TimeoutError</code> and marks the remote session <code>FAILED</code>.</li>
|
||||
<li>A prompt after authentication (in <code>get_titles()</code>, <code>get_tracks()</code> or licensing) raises
|
||||
<code>RuntimeError</code> at once. The client polls for prompts only during authentication, so
|
||||
no answer can come.</li>
|
||||
<li>A timeout raises <code>TimeoutError</code>. The remote session becomes <code>FAILED</code> when that error ends the login.</li>
|
||||
<li>A prompt after authentication (in <code>get_titles()</code>, <code>get_tracks()</code> or licensing) goes to
|
||||
the client on an open remote session channel. Without the channel it raises <code>RuntimeError</code>
|
||||
at once: the client polls for prompts only during authentication, so no answer can come.</li>
|
||||
<li>A CDM call (<code>InputBridge.request_cdm</code>) works during and after authentication, because the
|
||||
client also polls while its own requests run. A call that no client fetches within 10 seconds
|
||||
channel carries it, or the client polls while its own requests run. A call that no client fetches within 10 seconds
|
||||
fails then, because no client is listening. A fetched call waits 60 seconds for its answer.
|
||||
The call leaves the auth status as it was. An answer never marks the remote session as client-authenticated.</li>
|
||||
<li><code>AUTH_INPUT_TIMEOUT = 600.0</code> seconds. This is also the TTL granted to
|
||||
<code>AUTHENTICATING</code> / <code>PENDING_INPUT</code> sessions in the store.</li>
|
||||
<code>AUTHENTICATING</code> sessions in the store. A remote session that waits on a prompt stays <code>AUTHENTICATING</code>.</li>
|
||||
</ul>
|
||||
<p><code>GET /api/session/{id}/prompt</code> returns one of:</p>
|
||||
<div class="language-json highlight"><pre><span></span><code><span id="__span-8-1"><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a><span class="p">{</span><span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"authenticated"</span><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-8-2"><a id="__codelineno-8-2" name="__codelineno-8-2" href="#__codelineno-8-2"></a><span class="p">{</span><span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"authenticating"</span><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-8-3"><a id="__codelineno-8-3" name="__codelineno-8-3" href="#__codelineno-8-3"></a><span class="p">{</span><span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"pending_input"</span><span class="p">,</span><span class="w"> </span><span class="nt">"prompt"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Enter code: "</span><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-8-4"><a id="__codelineno-8-4" name="__codelineno-8-4" href="#__codelineno-8-4"></a><span class="p">{</span><span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"pending_input"</span><span class="p">,</span><span class="w"> </span><span class="nt">"prompt"</span><span class="p">:</span><span class="w"> </span><span class="s2">"..."</span><span class="p">,</span><span class="w"> </span><span class="nt">"cdm_call"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">"op"</span><span class="p">:</span><span class="w"> </span><span class="s2">"challenge"</span><span class="p">,</span><span class="w"> </span><span class="nt">"drm"</span><span class="p">:</span><span class="w"> </span><span class="s2">"widevine"</span><span class="p">,</span><span class="w"> </span><span class="nt">"init_data"</span><span class="p">:</span><span class="w"> </span><span class="s2">"..."</span><span class="p">,</span><span class="w"> </span><span class="nt">"license_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"OFFLINE"</span><span class="p">,</span><span class="w"> </span><span class="nt">"privacy_mode"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w"> </span><span class="nt">"service_certificate"</span><span class="p">:</span><span class="w"> </span><span class="s2">"..."</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-8-5"><a id="__codelineno-8-5" name="__codelineno-8-5" href="#__codelineno-8-5"></a><span class="p">{</span><span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"failed"</span><span class="p">,</span><span class="w"> </span><span class="nt">"error"</span><span class="p">:</span><span class="w"> </span><span class="s2">"...message..."</span><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-8-4"><a id="__codelineno-8-4" name="__codelineno-8-4" href="#__codelineno-8-4"></a><span class="p">{</span><span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"pending_input"</span><span class="p">,</span><span class="w"> </span><span class="nt">"prompt"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Scan the code, then press Enter"</span><span class="p">,</span><span class="w"> </span><span class="nt">"qr"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://login.example/scan"</span><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-8-5"><a id="__codelineno-8-5" name="__codelineno-8-5" href="#__codelineno-8-5"></a><span class="p">{</span><span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"pending_input"</span><span class="p">,</span><span class="w"> </span><span class="nt">"prompt"</span><span class="p">:</span><span class="w"> </span><span class="s2">"..."</span><span class="p">,</span><span class="w"> </span><span class="nt">"cdm_call"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">"op"</span><span class="p">:</span><span class="w"> </span><span class="s2">"challenge"</span><span class="p">,</span><span class="w"> </span><span class="nt">"drm"</span><span class="p">:</span><span class="w"> </span><span class="s2">"widevine"</span><span class="p">,</span><span class="w"> </span><span class="nt">"init_data"</span><span class="p">:</span><span class="w"> </span><span class="s2">"..."</span><span class="p">,</span><span class="w"> </span><span class="nt">"license_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"OFFLINE"</span><span class="p">,</span><span class="w"> </span><span class="nt">"privacy_mode"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w"> </span><span class="nt">"service_certificate"</span><span class="p">:</span><span class="w"> </span><span class="s2">"..."</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span>
|
||||
</span><span id="__span-8-6"><a id="__codelineno-8-6" name="__codelineno-8-6" href="#__codelineno-8-6"></a><span class="p">{</span><span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"failed"</span><span class="p">,</span><span class="w"> </span><span class="nt">"error"</span><span class="p">:</span><span class="w"> </span><span class="s2">"...message..."</span><span class="w"> </span><span class="p">}</span>
|
||||
</span></code></pre></div>
|
||||
<p>A <code>cdm_call</code> comes first, in any auth state. The client answers it with a JSON object in
|
||||
<code>response</code>: <code>{"session": "...", "challenge": "<base64>"}</code> for <code>challenge</code>,
|
||||
@@ -3038,6 +3079,74 @@ straight away does not see it twice.</p>
|
||||
<code>403 FORBIDDEN</code>. <code>POST /api/session/{id}/prompt</code> takes <code>{ "response": "..." }</code> and
|
||||
returns <code>{ "status": "accepted" }</code>. A post with no pending prompt is an
|
||||
<code>INVALID_INPUT</code> error.</p>
|
||||
<h3 id="the-remote-session-channel">The remote session channel<a class="headerlink" href="#the-remote-session-channel" title="Permanent link">¶</a></h3>
|
||||
<p><code>GET /api/session/{id}/channel</code> is a WebSocket that carries only the messages the server
|
||||
starts. Titles, tracks, licences, samples, the segment filter, bad content key reports, create
|
||||
and delete stay HTTP requests. The route takes the same API key and ownership checks as the
|
||||
other remote session routes.</p>
|
||||
<p>Each message is a JSON text frame with a <code>type</code> field:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><code>type</code></th>
|
||||
<th>From</th>
|
||||
<th>Fields</th>
|
||||
<th>Meaning</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>prompt</code></td>
|
||||
<td>server</td>
|
||||
<td><code>id</code>, <code>prompt</code>, <code>qr</code></td>
|
||||
<td>The service asks the user for input; <code>qr</code>, when present, is the text of a QR code to draw with it</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>cdm_call</code></td>
|
||||
<td>server</td>
|
||||
<td><code>id</code>, <code>call</code></td>
|
||||
<td>The service calls the client's CDM; <code>call</code> has the shape of the prompt route's <code>cdm_call</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>log</code></td>
|
||||
<td>server</td>
|
||||
<td><code>seq</code>, <code>level</code>, <code>message</code>, <code>ts</code>, <code>qr</code></td>
|
||||
<td>One record of the service log, with the same redaction as <code>GET /logs</code>; <code>qr</code>, when present, is the text of a QR code to draw under the message</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>status</code></td>
|
||||
<td>server</td>
|
||||
<td><code>status</code>, <code>error</code></td>
|
||||
<td>The login state, as the <code>status</code> of <code>GET /prompt</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>drain</code></td>
|
||||
<td>server</td>
|
||||
<td><code>draining</code></td>
|
||||
<td>The operator started or stopped a drain before a restart</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>answer</code></td>
|
||||
<td>client</td>
|
||||
<td><code>id</code>, <code>response</code>, <code>error</code></td>
|
||||
<td>The answer to the <code>prompt</code> or <code>cdm_call</code> with this <code>id</code>; <code>error</code> says why the client cannot answer a prompt, and the service stops at once</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>When the client connects, the server first sends the log records after <code>since</code>, the drain
|
||||
state, the prompts and CDM calls that the client did not answer, and the login state. A log
|
||||
record can arrive twice, after a reconnect; the client skips a <code>seq</code> it already has. Each
|
||||
prompt and CDM call goes to one path only: the channel, or the prompt routes.</p>
|
||||
<p>The server closes the channel with code <code>4404</code> when the remote session ends: a delete, an
|
||||
expiry, an eviction, or a server shutdown. The client then stops reconnecting, and its next
|
||||
request finds the remote session gone.</p>
|
||||
<p>The client polls the prompt and logs routes, and sends keep-alive requests, in these cases:</p>
|
||||
<ul>
|
||||
<li>A gateway in front of the server refuses the WebSocket upgrade, or the connection fails, when
|
||||
the client creates the remote session. The client polls for the life of the process and logs
|
||||
the refusal at debug level only.</li>
|
||||
<li>The channel drops. The client polls until it reconnects, with a backoff from 1 to 30 seconds.</li>
|
||||
</ul>
|
||||
<h3 id="sessionstore-internals"><code>SessionStore</code> internals<a class="headerlink" href="#sessionstore-internals" title="Permanent link">¶</a></h3>
|
||||
<p>Source: <code>unshackle/core/api/session_store.py</code>. A singleton you get from
|
||||
<code>get_session_store()</code>.</p>
|
||||
@@ -3045,12 +3154,11 @@ returns <code>{ "status": "accepted" }</code>. A post with no pending prompt is
|
||||
<li><strong>Config-driven limits.</strong> <code>serve.session_ttl</code> (default <code>300</code>) and
|
||||
<code>serve.max_sessions</code> (default <code>100</code>) are read as properties, so config changes
|
||||
take effect without recreating the store.</li>
|
||||
<li><strong><code>create()</code></strong> evicts the least-recently-accessed remote session when at capacity,
|
||||
then stores a new <code>SessionEntry</code>. It defaults <code>auth_status</code> to <code>AUTHENTICATED</code>, and
|
||||
the <code>create</code> handler overrides it to <code>AUTHENTICATING</code>.</li>
|
||||
<li><strong><code>create()</code></strong> evicts the least-recently-accessed remote session of the API key that holds the most when at capacity,
|
||||
then stores a complete <code>SessionEntry</code> from the fields of the <code>create</code> handler and publishes the <code>create</code> event.</li>
|
||||
<li><strong><code>get()</code></strong> refreshes <code>last_accessed</code> through <code>touch()</code>. It returns <code>None</code> (and
|
||||
deletes the entry) if an authenticated remote session has been idle longer than the
|
||||
TTL. Remote sessions in <code>AUTHENTICATING</code> / <code>PENDING_INPUT</code> are exempt from TTL expiry.</li>
|
||||
TTL. Remote sessions in <code>AUTHENTICATING</code> are exempt from TTL expiry.</li>
|
||||
<li><strong><code>cleanup_expired()</code></strong> runs every 60s: authenticated remote sessions expire at
|
||||
<code>ttl</code>, in-flight-auth remote sessions expire at <code>AUTH_INPUT_TIMEOUT</code>. The removal of
|
||||
a remote session cancels its <code>InputBridge</code> and deletes its cache directory (pruning
|
||||
@@ -3101,7 +3209,7 @@ returns <code>{ "status": "accepted" }</code>. A post with no pending prompt is
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>auth_status</code> / <code>auth_error</code></td>
|
||||
<td>Current <code>AuthStatus</code> and last error message</td>
|
||||
<td>Current <code>AuthStatus</code>, read from <code>input_bridge</code> (<code>AUTHENTICATED</code> without one), and last error message</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>created_at</code> / <code>last_accessed</code></td>
|
||||
@@ -3117,7 +3225,9 @@ returns <code>{ "status": "accepted" }</code>. A post with no pending prompt is
|
||||
On <code>DELETE</code>, when the login belongs to the client (<code>client_auth</code>) and the remote
|
||||
session does not run on the server's device, the handler harvests updated cache files from the whole directory tree (compressing each
|
||||
with zlib and base64-encoding, <strong>excluding</strong> <code>titles_*</code> files) and returns them
|
||||
under a <code>cache</code> field, so the client can keep refreshed tokens. Each cache key
|
||||
under a <code>cache</code> field, so the client can keep refreshed tokens. A remote session on the
|
||||
server's device keeps the files of the service's <code>IDENTITY_CACHE</code> in
|
||||
<code>_identity/<namespace>/<service></code> instead, so they are never in that tree. Each cache key
|
||||
is the file path relative to that directory, with <code>/</code> separators and no <code>.json</code>
|
||||
suffix, which is the <code>Cacher</code> cache key the service reads it with:</p>
|
||||
<div class="language-json highlight"><pre><span></span><code><span id="__span-10-1"><a id="__codelineno-10-1" name="__codelineno-10-1" href="#__codelineno-10-1"></a><span class="p">{</span>
|
||||
@@ -3131,7 +3241,7 @@ suffix, which is the <code>Cacher</code> cache key the service reads it with:</p
|
||||
<p>Both sides reject a cache key with a drive letter, a root, a <code>..</code> segment, an empty
|
||||
segment, or more than 8 segments before it becomes a path, so a peer cannot write
|
||||
outside the cache directory. Both sides also refuse a <code>cache</code> map with more than
|
||||
64 entries. The server skips a cache key it cannot write, such as one that names an
|
||||
256 entries, and the server refuses the request body of a remote session creation or of a search when it is larger than 8 MiB. The server also refuses a <code>cache</code> map whose files inflate to more than 16 MiB in total, with <code>400 INVALID_INPUT</code>. It checks every entry before it writes a file, and it removes the cache directory of a remote session creation that fails. The client gives a warning when it has more than 256 cache files or more than 16 MiB to send. It also stops saving the cache files that a server returns at 16 MiB. The server skips a cache key it cannot write, such as one that names an
|
||||
existing file as a directory, and logs a warning.</p>
|
||||
<h3 id="remote-session-info-response">Remote session info response<a class="headerlink" href="#remote-session-info-response" title="Permanent link">¶</a></h3>
|
||||
<p><code>GET /api/session/{id}</code>:</p>
|
||||
@@ -3145,8 +3255,9 @@ existing file as a directory, and logs a warning.</p>
|
||||
</span><span id="__span-11-8"><a id="__codelineno-11-8" name="__codelineno-11-8" href="#__codelineno-11-8"></a><span class="w"> </span><span class="nt">"title_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">40</span>
|
||||
</span><span id="__span-11-9"><a id="__codelineno-11-9" name="__codelineno-11-9" href="#__codelineno-11-9"></a><span class="p">}</span>
|
||||
</span></code></pre></div>
|
||||
<p><code>draining</code> is <code>true</code> after the operator starts a drain before a restart. The client reads
|
||||
it before each title, so it knows of the restart before it occurs.</p>
|
||||
<p><code>draining</code> is <code>true</code> after the operator starts a drain before a restart. The client checks
|
||||
it before each title, so it knows of the restart before it occurs. With an open remote session
|
||||
channel the client reads the <code>drain</code> message and sends no request.</p>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title"><code>expires_in</code> is the configured TTL, not time remaining</p>
|
||||
<p>The <code>expires_in</code> value reports the store's configured <code>session_ttl</code>, not the
|
||||
@@ -3154,7 +3265,9 @@ seconds left before this specific remote session expires.</p>
|
||||
</div>
|
||||
<h3 id="reference-client-remoteservice">Reference client: <code>RemoteService</code><a class="headerlink" href="#reference-client-remoteservice" title="Permanent link">¶</a></h3>
|
||||
<p>Source: <code>unshackle/core/remote_service.py</code>. This is the canonical consumer of the
|
||||
remote session API and a good template for any client.</p>
|
||||
remote session API and a good template for any client. The routes, the <code>AuthStatus</code> values,
|
||||
the error codes and the request and reply shapes that it shares with the server are in
|
||||
<code>unshackle/core/remote_protocol.py</code>.</p>
|
||||
<ul>
|
||||
<li><strong><code>RemoteClient.request</code></strong> sets <code>X-Secret-Key</code> and <code>User-Agent: unshackle/<version></code>,
|
||||
uses the server's <code>timeout</code> from <code>remote_services</code> (default 120s) as the read timeout,
|
||||
@@ -3171,8 +3284,8 @@ remote session API and a good template for any client.</p>
|
||||
output cannot start before the body is ready.</li>
|
||||
<li><strong>Retries.</strong> The download-side HTTP session mounts an adapter with
|
||||
<code>Retry(total=5, backoff_factor=0.2, status_forcelist=[429, 500, 502, 503, 504])</code>.</li>
|
||||
<li><strong>Flow.</strong> <code>authenticate()</code> → <code>create</code> (+ poll <code>prompt</code> every 2s up to a 600s
|
||||
deadline, answering <code>pending_input</code> prompts. With stdin closed the client logs an
|
||||
<li><strong>Flow.</strong> <code>authenticate()</code> → <code>create</code> (+ open the remote session channel, or poll <code>prompt</code>
|
||||
every 2s without it, up to a 600s deadline, answering <code>pending_input</code> prompts. With stdin closed the client logs an
|
||||
error and raises <code>SystemExit(1)</code> instead of posting an empty answer) → <code>get_titles()</code> → <code>get_tracks()</code>
|
||||
(merging returned <code>session_headers</code>/<code>session_cookie_jar</code>, re-parsing <code>manifests</code>) →
|
||||
get the licence in proxy mode or <code>server_cdm</code> mode → <code>close()</code> (<code>DELETE</code>, saving any returned
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2762,12 +2762,13 @@ Two kinds of members matter: <strong>class variables</strong> that give the deta
|
||||
<li><strong>DRM license hooks</strong>: <code>get_widevine_service_certificate</code>, <code>get_widevine_license</code>,
|
||||
<code>get_playready_license</code> (delegates to Widevine by default), and
|
||||
<code>get_clearkey_license</code> (returns <code>None</code> by default). See <a href="#drm-hooks">DRM hooks</a> below.</li>
|
||||
<li><strong><code>request_input(prompt)</code></strong>: prompts the user. It goes through the remote-dl input
|
||||
<li><strong><code>request_input(prompt, qr=None)</code></strong>: prompts the user. It goes through the remote-dl input
|
||||
bridge, the REST download job relay, or the rich console.</li>
|
||||
<li><strong><code>wait_for_approval(message, check, timeout, interval=3.0)</code></strong>: shows a message, then
|
||||
<li><strong><code>wait_for_approval(message, check, timeout, interval=3.0, qr=None)</code></strong>: shows a message, then
|
||||
calls <code>check</code> until it returns a value. Use it for a login that the user approves on
|
||||
another device, such as a pair code. A remote-dl session shows the message as a log
|
||||
line, and a REST download job shows it as the job's <code>notice</code>.</li>
|
||||
line, and a REST download job shows it as the job's <code>notice</code>. Both methods take <code>qr</code>, the
|
||||
text of a QR code to scan, and the terminal or UI that shows the user the message draws it.</li>
|
||||
<li><strong>Event callbacks</strong>: <code>on_segment_downloaded</code>, <code>on_track_downloaded</code>,
|
||||
<code>on_track_decrypted</code>, <code>on_track_repacked</code>, <code>on_track_multiplex</code> let a service react to
|
||||
pipeline events.</li>
|
||||
@@ -2818,7 +2819,7 @@ up the objects your methods rely on:</p>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>The constructor also resolves proxies: it reads <code>--proxy</code> and the <code>proxy_query</code> and
|
||||
<code>proxy_provider</code> context params that <code>dl</code> derives from it, consults the per-service
|
||||
<code>proxy_provider</code> context params that <code>dl</code> and <code>search</code> derive from it, consults the per-service
|
||||
<code>proxy_map</code>, and, if <code>GEOFENCE</code> is set and you did not give an explicit proxy, does a live
|
||||
IP check and auto-fetches a proxy to <code>GEOFENCE[0]</code> when it detects a geoblock. A
|
||||
<code>GEOBLOCK</code> hit with no <code>GEOFENCE</code> stops the run with a "not available in your region"
|
||||
@@ -2911,7 +2912,9 @@ final audio file under that suffix.
|
||||
You can set these fields in <code>get_tracks()</code> too, and a remote client gets them back.</p>
|
||||
<p>The tagger also falls back to <code>Song.data</code> for fields the constructor did not get, such
|
||||
as the composer or a full release date. It reads the top level of that dict and a
|
||||
nested <code>metadata</code> sub-dict, with the nested keys winning, so either shape works.</p>
|
||||
nested <code>metadata</code> sub-dict, with the nested keys winning, so either shape works. The keys
|
||||
that a remote client gets back are <code>MUSIC_DATA_KEYS</code> in <code>unshackle/core/titles/music.py</code>,
|
||||
for example <code>artists</code> (a list) and <code>replaygain_track_gain</code>.</p>
|
||||
<p>From <code>get_tracks()</code>, a music service gives <strong>one <code>Audio</code> track for each codec and
|
||||
bitrate it offers for a <code>Song</code></strong>. The framework then selects one with its usual audio
|
||||
options, <code>-a</code>/<code>--acodec</code> and <code>--abitrate</code>, and its usual audio sorting. A movie or an
|
||||
@@ -2922,15 +2925,9 @@ separates a hi-res FLAC from a CD FLAC, and the audio sort already ranks it.</p>
|
||||
music-specific service API and no separate music download loop. The
|
||||
<code>GROUP_AUDIO_DOWNLOADS</code> flag, <code>get_music_track_options</code> and <code>get_music_collection_label</code>
|
||||
no longer exist, and a music service does not need them.</p>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Restore the container in <code>on_track_downloaded</code></p>
|
||||
<p>Every track downloads to a temp file named <code>Audio_<id>.mp4</code> whatever it holds, and
|
||||
the final move keeps that suffix. A <code>Song</code> skips the muxer, so its download <strong>is</strong>
|
||||
the delivered file, and the tagger picks its metadata format from the suffix.
|
||||
Rename the track path to the true container in <code>on_track_downloaded</code>, or a FLAC
|
||||
lands as an untaggable <code>.mp4</code>. The event fires twice, once before decryption and
|
||||
once at the end, so wait until <code>track.drm</code> is clear before you rename.</p>
|
||||
</div>
|
||||
<p>Core picks the container of a <code>Song</code> from the codec in the downloaded file, so a music
|
||||
service does not rename the track path. Read
|
||||
<a href="../../guide/output-and-naming/#music-output-files">Music output files</a>.</p>
|
||||
<p>The <strong>MUSIC_EXAMPLE</strong> reference service, at <code>unshackle/services/MUSIC_EXAMPLE/</code>, shows
|
||||
the full music surface.</p>
|
||||
</div>
|
||||
@@ -2994,13 +2991,18 @@ delivery method in <code>Track.Descriptor</code>, which tells unshackle how to d
|
||||
<code>langcodes.Language</code>), <code>drm</code> (an optional iterable of DRM objects), <code>needs_repack</code>, and
|
||||
descriptor-specific state stashed in <code>track.data["hls"]</code> / <code>track.data["dash"]</code>. If you
|
||||
do not give a <code>name</code>, unshackle derives a human-readable name from the language.</p>
|
||||
<p>When each URL of a <code>URL</code> track costs a request, give the track an empty <code>url</code> and set
|
||||
<code>track.resolve_url</code> to a callable that returns the URL. unshackle calls it only for a
|
||||
track that it downloads. Over <code>--remote</code>, the client asks the server for the URL of
|
||||
each track it downloads, and the server calls the callable then. A track whose callable
|
||||
fails gets no URL, and its download fails.</p>
|
||||
<h3 id="video"><code>Video</code><a class="headerlink" href="#video" title="Permanent link">¶</a></h3>
|
||||
<p><code>Video</code> adds <code>codec</code>, <code>range</code>, <code>bitrate</code>, <code>width</code>, <code>height</code>, <code>fps</code>, <code>scan_type</code>, and
|
||||
closed-caption descriptors. The relevant enums:</p>
|
||||
<ul>
|
||||
<li><strong><code>Video.Codec</code></strong>: <code>AVC</code> (H.264), <code>HEVC</code> (H.265), <code>VC1</code>, <code>VP8</code>, <code>VP9</code>, <code>AV1</code>, <code>LCEVC</code>.</li>
|
||||
<li><strong><code>Video.Range</code></strong>: <code>SDR</code>, <code>HLG</code>, <code>HDR10</code>, <code>HDR10P</code> (HDR10+), <code>DV</code> (Dolby Vision), and
|
||||
<code>HYBRID</code>. <code>HYBRID</code> is special: it tells the pipeline to select both an HDR10(+) base and
|
||||
<li><strong><code>Video.Range</code></strong>: <code>SDR</code>, <code>HLG</code>, <code>HDR10</code>, <code>HDR10P</code> (HDR10+), <code>VIVID</code> (HDR Vivid), <code>DV</code> (Dolby
|
||||
Vision), and <code>HYBRID</code>. <code>HYBRID</code> is special: it tells the pipeline to select both an HDR10(+) base and
|
||||
a DV track and merge the DV RPU onto the HDR10 track with <code>dovi_tool</code> (see
|
||||
<a href="#dolby-vision-and-hybrid">Dolby Vision hybrid</a>).</li>
|
||||
</ul>
|
||||
@@ -3012,14 +3014,14 @@ string form displays kb/s, and <code>--vbitrate</code> and <code>--abitrate</cod
|
||||
<h3 id="audio"><code>Audio</code><a class="headerlink" href="#audio" title="Permanent link">¶</a></h3>
|
||||
<p><code>Audio</code> adds <code>bitrate</code>, <code>channels</code>, <code>joc</code> (Joint Object Coding, the Atmos indicator),
|
||||
and <code>descriptive</code>. <code>Audio.Codec</code> covers <code>AAC</code>, <code>AC3</code> (<code>DD</code>), <code>EC3</code> (<code>DD+</code>), <code>AC4</code>,
|
||||
<code>OPUS</code>, <code>OGG</code> (Vorbis), <code>DTS</code>, <code>DTSX</code>, <code>DTSHD</code>, <code>MPEGH</code>, <code>ALAC</code>, <code>FLAC</code>, and <code>MP3</code>. The <code>atmos</code> property is <code>True</code> when
|
||||
<code>OPUS</code>, <code>OGG</code> (Vorbis), <code>DTS</code>, <code>DTSX</code>, <code>DTSHD</code>, <code>MPEGH</code>, <code>AV3A</code> (Audio Vivid), <code>ALAC</code>, <code>FLAC</code>, and <code>MP3</code>. The <code>atmos</code> property is <code>True</code> when
|
||||
<code>joc</code> is set (or when <code>extra</code> flags it).</p>
|
||||
<h3 id="subtitle"><code>Subtitle</code><a class="headerlink" href="#subtitle" title="Permanent link">¶</a></h3>
|
||||
<p><code>Subtitle</code> adds three mutually-constrained flags: <code>cc</code> (closed captions), <code>sdh</code>
|
||||
(subtitles for the deaf and hard-of-hearing), and <code>forced</code>. A track cannot be both <code>cc</code>
|
||||
and <code>sdh</code>, and <code>forced</code> cannot combine with either. <code>Subtitle.Codec</code> includes <code>SubRip</code>
|
||||
(SRT), <code>WebVTT</code> (VTT), <code>SubStationAlpha</code>/<code>SubStationAlphav4</code> (SSA/ASS),
|
||||
<code>TimedTextMarkupLang</code> (TTML), <code>SAMI</code>, and the box-encapsulated DASH formats <code>fTTML</code>
|
||||
<code>TimedTextMarkupLang</code> (TTML), <code>SAMI</code>, <code>SCC</code>, and the box-encapsulated DASH formats <code>fTTML</code>
|
||||
(STPP) and <code>fVTT</code> (WVTT). Subtitles receive post-download normalization
|
||||
(segment merging, WebVTT sanitization, format conversion, and optional SDH stripping),
|
||||
all documented for users in <a href="../../guide/subtitles/">Subtitles</a>.</p>
|
||||
@@ -3104,7 +3106,14 @@ because HLS variants carry no language.</p>
|
||||
<ul>
|
||||
<li><strong>DASH</strong> enumerates tracks from only the <em>first</em> content period, but downloads segments
|
||||
from <em>all</em> content periods matching the representation. The parser reads <code>SegmentTemplate</code>,
|
||||
<code>SegmentList</code>, and <code>SegmentBase</code> addressing, and <code>$Number%0Nd$</code> padding.</li>
|
||||
<code>SegmentList</code>, and <code>SegmentBase</code> addressing, and <code>$Number%0Nd$</code> padding.
|
||||
When a period's fragment timeline starts again near 0, as in a stitched ad stream that
|
||||
packages each part of the title on its own, the merge moves that period to follow the
|
||||
periods it keeps before it. A timeline that continues is not changed, so the gaps of filtered ad
|
||||
periods stay in it. Audio that runs past a period join is cut where the next period
|
||||
starts. Plain WebVTT periods and HLS subtitles across <code>EXT-X-DISCONTINUITY</code> blocks
|
||||
get the same treatment: fVTT through its tfdt, and WebVTT through its cue times, which move to
|
||||
the block's playlist start when that puts more cues inside the block.</li>
|
||||
<li><strong>HLS</strong> re-fetches the media playlist at download time, recovers <code>SUPPLEMENTAL-CODECS</code>
|
||||
from raw text (python-m3u8 drops it) to detect Dolby Vision composite streams, and uses
|
||||
the media-sequence-number IV for AES-128 keys that have no explicit IV.</li>
|
||||
@@ -3116,7 +3125,7 @@ because HLS variants carry no language.</p>
|
||||
</ul>
|
||||
<h2 id="drm-hooks">DRM hooks<a class="headerlink" href="#drm-hooks" title="Permanent link">¶</a></h2>
|
||||
<p>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 six DRM systems:</p>
|
||||
service to talk to the platform's license server. unshackle recognizes seven DRM systems:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -3156,6 +3165,11 @@ service to talk to the platform's license server. unshackle recognizes six DRM s
|
||||
<td>Blowfish CBC stripe cipher</td>
|
||||
<td>the service gives the per-track key; no CDM, no license server</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>ClearKeyCTR</code></td>
|
||||
<td>AES-128-CTR over a whole file</td>
|
||||
<td>the service gives the IV and licenses the content key at the licence step; no CDM, no license server</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="admonition warning">
|
||||
@@ -3234,6 +3248,7 @@ the API surface.</p>
|
||||
HLS and DASH streams that carry a valid DV RPU but advertise plain HEVC, with DV only in the
|
||||
supplemental codecs (<code>dv_compatible_bitstream</code>). <code>--list</code> shows such a track as <code>HDR10+DV</code> or <code>HDR10P+DV</code>.
|
||||
A service sets <code>hdr10_base</code> on a DV track that has an HDR10 base layer (DV profile 8.1), and <code>--list</code> shows it as <code>DV+HDR10</code>.
|
||||
The HLS and DASH parsers set <code>stereo</code> on a stereoscopic 3D (MV-HEVC) track: an HLS <code>REQ-VIDEO-LAYOUT</code> that names <code>CH-STEREO</code>, or a DV profile 20 codec. <code>--list</code> shows it as <code>3D</code>.
|
||||
<strong>Hybrid</strong> processing (<code>Video.Range.HYBRID</code>) selects an HDR10(+) base and a DV donor,
|
||||
extracts the RPU with <code>dovi_tool</code>, and injects it onto the base layer, to make a single
|
||||
track that carries both HDR10 metadata and the DV RPU. Both are automatic once the
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2532,7 +2532,7 @@ warning and prints the <code>directories</code> lines to add.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://ffmpeg.org/">FFmpeg</a></td>
|
||||
<td>≥ 6.0</td>
|
||||
<td>≥ 6.0, or ≥ 8.0 for H.266</td>
|
||||
<td>Media processing and analysis</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -2703,7 +2703,7 @@ download. For example, <code>dovi_tool</code> only matters if you download Dolby
|
||||
<tr>
|
||||
<td>MP4Box (GPAC)</td>
|
||||
<td><code>MP4Box</code></td>
|
||||
<td>Muxing DTS:X Profile 2 (DTS-UHD) and MPEG-H audio</td>
|
||||
<td>Muxing DTS:X Profile 2 (DTS-UHD) and MPEG-H audio, and 3D video; remuxing AC-4, MPEG-H and DTS-UHD music; trimming the coder delay of AAC files in a paged container</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dovi_tool</td>
|
||||
@@ -2758,9 +2758,11 @@ download. For example, <code>dovi_tool</code> only matters if you download Dolby
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="admonition info">
|
||||
<p class="admonition-title">MP4Box is only used for DTS:X Profile 2 and MPEG-H</p>
|
||||
<p>Titles with DTS:X Profile 2 (DTS-UHD) or MPEG-H audio mux to MP4; everything else muxes to MKV
|
||||
with <code>mkvmerge</code>. Install with <code>apt install gpac</code>.</p>
|
||||
<p class="admonition-title">MP4Box is only used for DTS:X Profile 2, MPEG-H, AC-4 music, 3D video and paged AAC</p>
|
||||
<p>Titles with DTS:X Profile 2 (DTS-UHD) or MPEG-H audio, or a stereoscopic 3D video track, mux to
|
||||
MP4; everything else muxes to MKV with <code>mkvmerge</code>. Install with <code>apt install gpac</code>.</p>
|
||||
<p>AAC files that come in a paged container need MP4Box only to lose the coder delay of the encoder
|
||||
and to declare HE-AACv2, see <a href="../../guide/drm-and-cdm/">DRM and CDM</a>. Without MP4Box they keep the delay.</p>
|
||||
</div>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">SubtitleEdit specifics</p>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -3037,7 +3037,7 @@
|
||||
<tr>
|
||||
<td><code>-v</code>, <code>--vcodec</code></td>
|
||||
<td>any</td>
|
||||
<td>Video codec(s). Accepts names or values: <code>AVC</code>/<code>H.264</code>/<code>H264</code>, <code>HEVC</code>/<code>H.265</code>/<code>H265</code>, <code>VC1</code>/<code>VC-1</code>, <code>VP8</code>, <code>VP9</code>, <code>AV1</code>.</td>
|
||||
<td>Video codec(s). Accepts names or values: <code>AVC</code>/<code>H.264</code>/<code>H264</code>, <code>HEVC</code>/<code>H.265</code>/<code>H265</code>, <code>VVC</code>/<code>H.266</code>/<code>H266</code>, <code>VC1</code>/<code>VC-1</code>, <code>VP8</code>, <code>VP9</code>, <code>AV1</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>-a</code>, <code>--acodec</code></td>
|
||||
@@ -3067,7 +3067,7 @@
|
||||
<tr>
|
||||
<td><code>-r</code>, <code>--range</code></td>
|
||||
<td><code>SDR</code></td>
|
||||
<td>Colour range(s): <code>SDR</code>, <code>HLG</code>, <code>HDR10</code>, <code>HDR10P</code> (HDR10+), <code>DV</code>, <code>HYBRID</code>.</td>
|
||||
<td>Colour range(s): <code>SDR</code>, <code>HLG</code>, <code>HDR10</code>, <code>HDR10P</code> (HDR10+), <code>VIVID</code> (HDR Vivid), <code>DV</code>, <code>HYBRID</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>--generate-dv</code></td>
|
||||
@@ -3087,7 +3087,7 @@
|
||||
<tr>
|
||||
<td><code>--worst</code></td>
|
||||
<td>off</td>
|
||||
<td>Pick the lowest bitrate within the requested quality. <strong>Requires <code>-q</code>.</strong></td>
|
||||
<td>Pick the lowest-bitrate video at each requested resolution, or at the lowest resolution if none is set.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>--best-available</code>, <code>--warn-only</code></td>
|
||||
@@ -3156,6 +3156,11 @@
|
||||
<td>Subtitle langs that must exist. Fails the title if one is missing. <code>--s-lang</code> still decides what to keep.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>--skip-missing</code></td>
|
||||
<td>off</td>
|
||||
<td>Skip a title that misses a required language or track, and continue with the next title. A run with one title, or a run that skips every title, still fails.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>-fs</code>, <code>--forced-subs</code></td>
|
||||
<td>off</td>
|
||||
<td>Include forced subtitle tracks.</td>
|
||||
@@ -3539,7 +3544,7 @@ and keeps the service's numbering unchanged. Pick an order that covers the whole
|
||||
</table>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Some flags cannot be combined</p>
|
||||
<p><code>--select-titles</code> and <code>--wanted</code> are mutually exclusive. <code>--worst</code> needs <code>--quality</code>. <code>--vbitrate</code> and <code>--vbitrate-range</code> (and the audio equivalents) are mutually exclusive.</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>
|
||||
<hr />
|
||||
<h2 id="search"><code>search</code><a class="headerlink" href="#search" title="Permanent link">¶</a></h2>
|
||||
|
||||
+119
-80
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -3258,7 +3258,8 @@ filtering. <code>--skip-dl</code> runs the license step but skips the actual seg
|
||||
<h2 id="choosing-quality">Choosing quality<a class="headerlink" href="#choosing-quality" title="Permanent link">¶</a></h2>
|
||||
<h3 id="resolution">Resolution<a class="headerlink" href="#resolution" title="Permanent link">¶</a></h3>
|
||||
<p><code>-q</code> / <code>--quality</code> takes one or more target resolutions (heights) as a comma-separated
|
||||
list. Without it, unshackle picks the <strong>best available</strong> resolution.</p>
|
||||
list. Without it, unshackle picks the <strong>best available</strong> resolution, or the lowest resolution with
|
||||
<code>--worst</code>.</p>
|
||||
<div class="language-shell highlight"><span class="filename">Single resolution</span><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-q<span class="w"> </span><span class="m">1080</span><span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<div class="language-shell highlight"><span class="filename">Multiple resolutions in one run</span><pre><span></span><code><span id="__span-4-1"><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-q<span class="w"> </span><span class="m">2160</span>,1080,720<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
@@ -3288,10 +3289,13 @@ therefore keeps its <code>3840×1920</code> HDR10 track, even when another range
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>--worst</code></td>
|
||||
<td>Within the specified quality, pick the <strong>lowest</strong> bitrate rendition. <strong>Requires <code>-q/--quality</code>.</strong></td>
|
||||
<td>Pick the lowest-bitrate video at each requested resolution. With no requested resolution, pick the lowest-bitrate video at the lowest resolution.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>A <code>quality</code> in the config counts as a requested resolution. When <code>--best-available</code> finds none of the
|
||||
requested resolutions, <code>--worst</code> also picks from the lowest resolution. In hybrid mode, that is the
|
||||
lowest resolution that has an HDR10 or HDR10+ base.</p>
|
||||
<div class="language-shell highlight"><span class="filename">Never fail on a missing resolution</span><pre><span></span><code><span id="__span-5-1"><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-q<span class="w"> </span><span class="m">2160</span><span class="w"> </span>--best-available<span class="w"> </span>EXAMPLE<span class="w"> </span>0ABC123
|
||||
</span></code></pre></div>
|
||||
<h2 id="video-codec-and-colour-range">Video codec and colour range<a class="headerlink" href="#video-codec-and-colour-range" title="Permanent link">¶</a></h2>
|
||||
@@ -3315,6 +3319,10 @@ either enum <strong>names</strong> or their <strong>values</strong>, comma-separ
|
||||
<td><code>H.265</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>VVC</code></td>
|
||||
<td><code>H.266</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>VC1</code></td>
|
||||
<td><code>VC-1</code></td>
|
||||
</tr>
|
||||
@@ -3336,7 +3344,7 @@ either enum <strong>names</strong> or their <strong>values</strong>, comma-separ
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><code>H264</code> and <code>H265</code> are aliases of <code>AVC</code> and <code>HEVC</code>.</p>
|
||||
<p><code>H264</code>, <code>H265</code> and <code>H266</code> are aliases of <code>AVC</code>, <code>HEVC</code> and <code>VVC</code>.</p>
|
||||
<p>An LCEVC (MPEG-5 Part 2) track only adds detail on top of its base video track and cannot play
|
||||
alone, so unshackle selects it only when you ask for it with <code>-v LCEVC</code>.</p>
|
||||
<div class="language-shell highlight"><span class="filename">Either spelling works</span><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>dl<span class="w"> </span>-v<span class="w"> </span>HEVC<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
@@ -3370,6 +3378,10 @@ alone, so unshackle selects it only when you ask for it with <code>-v LCEVC</cod
|
||||
<td>HDR10+ (<code>-r HDR10+</code> also works)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>VIVID</code></td>
|
||||
<td>HDR Vivid (<code>-r "HDR Vivid"</code> also works)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>DV</code></td>
|
||||
<td>Dolby Vision</td>
|
||||
</tr>
|
||||
@@ -3415,6 +3427,9 @@ alone, so unshackle selects it only when you ask for it with <code>-v LCEVC</cod
|
||||
</tbody>
|
||||
</table>
|
||||
<p>The output file of a track with a Dolby Vision profile 8 RPU plays as Dolby Vision on a DV screen.</p>
|
||||
<p><code>--list</code> adds <code>3D</code> to a stereoscopic 3D (MV-HEVC) track, for example <code>[H.265, DV, 3D]</code>. When a title
|
||||
has a 2D and a 3D track at the same resolution, unshackle selects the 2D track. A 3D title muxes to
|
||||
MP4, see <a href="../output-and-naming/#3d-output">3D output</a>.</p>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">HYBRID requires dovi_tool</p>
|
||||
<p><code>-r HYBRID</code> makes a single hybrid track by injecting the Dolby Vision RPU
|
||||
@@ -3509,7 +3524,9 @@ download and the HDR10 track are not changed.</p>
|
||||
</div>
|
||||
<h2 id="bitrate-selection">Bitrate selection<a class="headerlink" href="#bitrate-selection" title="Permanent link">¶</a></h2>
|
||||
<p>By default unshackle keeps the highest-bitrate rendition for each selected
|
||||
resolution/codec/range/language combination. You can constrain this.</p>
|
||||
resolution/codec/range/language combination. One requested video language is one
|
||||
language here, also when it matches more than one regional tag (<code>en</code> can match
|
||||
<code>en-AU</code> and <code>en-GB</code>). You can constrain this.</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -3567,6 +3584,8 @@ That is the real <em>delivered</em> size, not an over-report or a bug.</p>
|
||||
declared-bitrate renditions of each quality tier, in parallel (video grouped by codec
|
||||
and range, audio by codec, channels, language, and descriptive flag). It extends a
|
||||
group downward while a lower unprobed rendition could still outrank a probed one.
|
||||
The lowest renditions are often not probed, so <code>--worst</code> usually compares their
|
||||
manifest bitrates.
|
||||
This keeps probing fast even when a service exposes dozens of renditions. A track
|
||||
whose duration unshackle cannot find falls back to <code>ffprobe</code>. A probe failure is
|
||||
non-fatal: the manifest value stays in place.</p>
|
||||
@@ -3634,6 +3653,11 @@ non-fatal: the manifest value stays in place.</p>
|
||||
<td>MPEG-H 3D Audio</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>AV3A</code></td>
|
||||
<td><code>Audio Vivid</code></td>
|
||||
<td>Audio Vivid (AVS3-P3)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>ALAC</code></td>
|
||||
<td><code>ALAC</code></td>
|
||||
<td>Apple Lossless</td>
|
||||
@@ -3803,6 +3827,14 @@ so never report a missing language on their own:</p>
|
||||
<p>The check runs against the full track list, before any language selection or exclusion.
|
||||
<code>orig</code> resolves to the title language, and <code>--exact-lang</code> applies. Audio carried inside the
|
||||
video track counts. <code>--no-audio</code> and <code>--no-video</code> drop the matching requirement.</p>
|
||||
<p>A failed title stops the whole run. To skip that title and come back for it later, add
|
||||
<code>--skip-missing</code>, or set <code>skip_missing: true</code> under <code>dl:</code> in <code>unshackle.yaml</code>. It also skips a
|
||||
title that has no track for a filter such as <code>-q</code>, <code>-v</code>, <code>-r</code>, <code>-a</code> or a language you request.
|
||||
A run with one title, or a run that skips every title, still fails. A REST API job lists each
|
||||
skipped title and the reason in <code>skipped_titles</code>.</p>
|
||||
<div class="language-bash highlight"><pre><span></span><code><span id="__span-23-1"><a id="__codelineno-23-1" name="__codelineno-23-1" href="#__codelineno-23-1"></a><span class="c1"># download the episodes that have Korean audio, skip the others</span>
|
||||
</span><span id="__span-23-2"><a id="__codelineno-23-2" name="__codelineno-23-2" href="#__codelineno-23-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-al<span class="w"> </span>ko,en<span class="w"> </span>--require-audio<span class="w"> </span>ko<span class="w"> </span>--skip-missing<span class="w"> </span>-w<span class="w"> </span>S06<span class="w"> </span>EXAMPLE<span class="w"> </span>0ABC123
|
||||
</span></code></pre></div>
|
||||
<h3 id="forced-subtitles-and-output-format">Forced subtitles and output format<a class="headerlink" href="#forced-subtitles-and-output-format" title="Permanent link">¶</a></h3>
|
||||
<ul>
|
||||
<li><code>-fs</code> / <code>--forced-subs</code>: include forced subtitle tracks (signs/foreign dialogue).
|
||||
@@ -3851,7 +3883,7 @@ video track counts. <code>--no-audio</code> and <code>--no-video</code> drop the
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="language-shell highlight"><span class="filename">Convert subtitles to SRT</span><pre><span></span><code><span id="__span-23-1"><a id="__codelineno-23-1" name="__codelineno-23-1" href="#__codelineno-23-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--sub-format<span class="w"> </span>srt<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Convert subtitles to SRT</span><pre><span></span><code><span id="__span-24-1"><a id="__codelineno-24-1" name="__codelineno-24-1" href="#__codelineno-24-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--sub-format<span class="w"> </span>srt<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">SDH stripping happens by default</p>
|
||||
@@ -3871,42 +3903,42 @@ with <code>-</code> to exclude it. For a music release, the same option takes tr
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="1:5"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><input id="__tabbed_1_3" name="__tabbed_1" type="radio" /><input id="__tabbed_1_4" name="__tabbed_1" type="radio" /><input id="__tabbed_1_5" name="__tabbed_1" type="radio" /><div class="tabbed-labels"><label for="__tabbed_1_1">Whole seasons</label><label for="__tabbed_1_2">Specific episodes</label><label for="__tabbed_1_3">Exclusions</label><label for="__tabbed_1_4">Split episodes</label><label for="__tabbed_1_5">Air dates</label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-24-1"><a id="__codelineno-24-1" name="__codelineno-24-1" href="#__codelineno-24-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-24-2"><a id="__codelineno-24-2" name="__codelineno-24-2" href="#__codelineno-24-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01-S03<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-24-3"><a id="__codelineno-24-3" name="__codelineno-24-3" href="#__codelineno-24-3"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01,S03,S05<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-25-1"><a id="__codelineno-25-1" name="__codelineno-25-1" href="#__codelineno-25-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-25-2"><a id="__codelineno-25-2" name="__codelineno-25-2" href="#__codelineno-25-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01-S03<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-25-3"><a id="__codelineno-25-3" name="__codelineno-25-3" href="#__codelineno-25-3"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01,S03,S05<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-25-1"><a id="__codelineno-25-1" name="__codelineno-25-1" href="#__codelineno-25-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01E01<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-25-2"><a id="__codelineno-25-2" name="__codelineno-25-2" href="#__codelineno-25-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01E01-S01E05<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-25-3"><a id="__codelineno-25-3" name="__codelineno-25-3" href="#__codelineno-25-3"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01E01-S02E03<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-26-1"><a id="__codelineno-26-1" name="__codelineno-26-1" href="#__codelineno-26-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01E01<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-26-2"><a id="__codelineno-26-2" name="__codelineno-26-2" href="#__codelineno-26-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01E01-S01E05<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-26-3"><a id="__codelineno-26-3" name="__codelineno-26-3" href="#__codelineno-26-3"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01E01-S02E03<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-26-1"><a id="__codelineno-26-1" name="__codelineno-26-1" href="#__codelineno-26-1"></a><span class="c1"># Seasons 1 through 5, but not season 3</span>
|
||||
</span><span id="__span-26-2"><a id="__codelineno-26-2" name="__codelineno-26-2" href="#__codelineno-26-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01-S05,-S03<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-27-1"><a id="__codelineno-27-1" name="__codelineno-27-1" href="#__codelineno-27-1"></a><span class="c1"># Seasons 1 through 5, but not season 3</span>
|
||||
</span><span id="__span-27-2"><a id="__codelineno-27-2" name="__codelineno-27-2" href="#__codelineno-27-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01-S05,-S03<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-27-1"><a id="__codelineno-27-1" name="__codelineno-27-1" href="#__codelineno-27-1"></a><span class="c1"># Part 2 of episode 1 only</span>
|
||||
</span><span id="__span-27-2"><a id="__codelineno-27-2" name="__codelineno-27-2" href="#__codelineno-27-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01E01.2<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-27-3"><a id="__codelineno-27-3" name="__codelineno-27-3" href="#__codelineno-27-3"></a>
|
||||
</span><span id="__span-27-4"><a id="__codelineno-27-4" name="__codelineno-27-4" href="#__codelineno-27-4"></a><span class="c1"># Parts 1 through 3 of episode 1</span>
|
||||
</span><span id="__span-27-5"><a id="__codelineno-27-5" name="__codelineno-27-5" href="#__codelineno-27-5"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01E01.1-S01E01.3<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-27-6"><a id="__codelineno-27-6" name="__codelineno-27-6" href="#__codelineno-27-6"></a>
|
||||
</span><span id="__span-27-7"><a id="__codelineno-27-7" name="__codelineno-27-7" href="#__codelineno-27-7"></a><span class="c1"># All of season 1 except episode 1 part 2</span>
|
||||
</span><span id="__span-27-8"><a id="__codelineno-27-8" name="__codelineno-27-8" href="#__codelineno-27-8"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01,-S01E01.2<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-28-1"><a id="__codelineno-28-1" name="__codelineno-28-1" href="#__codelineno-28-1"></a><span class="c1"># One day</span>
|
||||
</span><span id="__span-28-2"><a id="__codelineno-28-2" name="__codelineno-28-2" href="#__codelineno-28-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">2026</span>-08-11<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-28-1"><a id="__codelineno-28-1" name="__codelineno-28-1" href="#__codelineno-28-1"></a><span class="c1"># Part 2 of episode 1 only</span>
|
||||
</span><span id="__span-28-2"><a id="__codelineno-28-2" name="__codelineno-28-2" href="#__codelineno-28-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01E01.2<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-28-3"><a id="__codelineno-28-3" name="__codelineno-28-3" href="#__codelineno-28-3"></a>
|
||||
</span><span id="__span-28-4"><a id="__codelineno-28-4" name="__codelineno-28-4" href="#__codelineno-28-4"></a><span class="c1"># A range of days, colon separated</span>
|
||||
</span><span id="__span-28-5"><a id="__codelineno-28-5" name="__codelineno-28-5" href="#__codelineno-28-5"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">2026</span>-08-01:2026-08-31<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-28-4"><a id="__codelineno-28-4" name="__codelineno-28-4" href="#__codelineno-28-4"></a><span class="c1"># Parts 1 through 3 of episode 1</span>
|
||||
</span><span id="__span-28-5"><a id="__codelineno-28-5" name="__codelineno-28-5" href="#__codelineno-28-5"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01E01.1-S01E01.3<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-28-6"><a id="__codelineno-28-6" name="__codelineno-28-6" href="#__codelineno-28-6"></a>
|
||||
</span><span id="__span-28-7"><a id="__codelineno-28-7" name="__codelineno-28-7" href="#__codelineno-28-7"></a><span class="c1"># August, but not the 15th</span>
|
||||
</span><span id="__span-28-8"><a id="__codelineno-28-8" name="__codelineno-28-8" href="#__codelineno-28-8"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">2026</span>-08-01:2026-08-31,-2026-08-15<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-28-7"><a id="__codelineno-28-7" name="__codelineno-28-7" href="#__codelineno-28-7"></a><span class="c1"># All of season 1 except episode 1 part 2</span>
|
||||
</span><span id="__span-28-8"><a id="__codelineno-28-8" name="__codelineno-28-8" href="#__codelineno-28-8"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01,-S01E01.2<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-29-1"><a id="__codelineno-29-1" name="__codelineno-29-1" href="#__codelineno-29-1"></a><span class="c1"># One day</span>
|
||||
</span><span id="__span-29-2"><a id="__codelineno-29-2" name="__codelineno-29-2" href="#__codelineno-29-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">2026</span>-08-11<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-29-3"><a id="__codelineno-29-3" name="__codelineno-29-3" href="#__codelineno-29-3"></a>
|
||||
</span><span id="__span-29-4"><a id="__codelineno-29-4" name="__codelineno-29-4" href="#__codelineno-29-4"></a><span class="c1"># A range of days, colon separated</span>
|
||||
</span><span id="__span-29-5"><a id="__codelineno-29-5" name="__codelineno-29-5" href="#__codelineno-29-5"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">2026</span>-08-01:2026-08-31<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-29-6"><a id="__codelineno-29-6" name="__codelineno-29-6" href="#__codelineno-29-6"></a>
|
||||
</span><span id="__span-29-7"><a id="__codelineno-29-7" name="__codelineno-29-7" href="#__codelineno-29-7"></a><span class="c1"># August, but not the 15th</span>
|
||||
</span><span id="__span-29-8"><a id="__codelineno-29-8" name="__codelineno-29-8" href="#__codelineno-29-8"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">2026</span>-08-01:2026-08-31,-2026-08-15<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3918,30 +3950,30 @@ track on disc 1, which is the number the track list shows for a single-disc rele
|
||||
<div class="tabbed-set tabbed-alternate" data-tabs="2:3"><input checked="checked" id="__tabbed_2_1" name="__tabbed_2" type="radio" /><input id="__tabbed_2_2" name="__tabbed_2" type="radio" /><input id="__tabbed_2_3" name="__tabbed_2" type="radio" /><div class="tabbed-labels"><label for="__tabbed_2_1">Tracks</label><label for="__tabbed_2_2">More than one disc</label><label for="__tabbed_2_3">Exclusions</label></div>
|
||||
<div class="tabbed-content">
|
||||
<div class="tabbed-block">
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-29-1"><a id="__codelineno-29-1" name="__codelineno-29-1" href="#__codelineno-29-1"></a><span class="c1"># Track 3</span>
|
||||
</span><span id="__span-29-2"><a id="__codelineno-29-2" name="__codelineno-29-2" href="#__codelineno-29-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">3</span><span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-29-3"><a id="__codelineno-29-3" name="__codelineno-29-3" href="#__codelineno-29-3"></a>
|
||||
</span><span id="__span-29-4"><a id="__codelineno-29-4" name="__codelineno-29-4" href="#__codelineno-29-4"></a><span class="c1"># Tracks 1 through 5</span>
|
||||
</span><span id="__span-29-5"><a id="__codelineno-29-5" name="__codelineno-29-5" href="#__codelineno-29-5"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">1</span>-5<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-29-6"><a id="__codelineno-29-6" name="__codelineno-29-6" href="#__codelineno-29-6"></a>
|
||||
</span><span id="__span-29-7"><a id="__codelineno-29-7" name="__codelineno-29-7" href="#__codelineno-29-7"></a><span class="c1"># Tracks 1, 3 and 7</span>
|
||||
</span><span id="__span-29-8"><a id="__codelineno-29-8" name="__codelineno-29-8" href="#__codelineno-29-8"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">1</span>,3,7<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-30-1"><a id="__codelineno-30-1" name="__codelineno-30-1" href="#__codelineno-30-1"></a><span class="c1"># Disc 2, track 3</span>
|
||||
</span><span id="__span-30-2"><a id="__codelineno-30-2" name="__codelineno-30-2" href="#__codelineno-30-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>2x3<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-30-1"><a id="__codelineno-30-1" name="__codelineno-30-1" href="#__codelineno-30-1"></a><span class="c1"># Track 3</span>
|
||||
</span><span id="__span-30-2"><a id="__codelineno-30-2" name="__codelineno-30-2" href="#__codelineno-30-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">3</span><span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-30-3"><a id="__codelineno-30-3" name="__codelineno-30-3" href="#__codelineno-30-3"></a>
|
||||
</span><span id="__span-30-4"><a id="__codelineno-30-4" name="__codelineno-30-4" href="#__codelineno-30-4"></a><span class="c1"># Disc 2, tracks 1 through 4</span>
|
||||
</span><span id="__span-30-5"><a id="__codelineno-30-5" name="__codelineno-30-5" href="#__codelineno-30-5"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>2x1-2x4<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-30-4"><a id="__codelineno-30-4" name="__codelineno-30-4" href="#__codelineno-30-4"></a><span class="c1"># Tracks 1 through 5</span>
|
||||
</span><span id="__span-30-5"><a id="__codelineno-30-5" name="__codelineno-30-5" href="#__codelineno-30-5"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">1</span>-5<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-30-6"><a id="__codelineno-30-6" name="__codelineno-30-6" href="#__codelineno-30-6"></a>
|
||||
</span><span id="__span-30-7"><a id="__codelineno-30-7" name="__codelineno-30-7" href="#__codelineno-30-7"></a><span class="c1"># Disc 1 track 3, through disc 2 track 2</span>
|
||||
</span><span id="__span-30-8"><a id="__codelineno-30-8" name="__codelineno-30-8" href="#__codelineno-30-8"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>1x3-2x2<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-30-7"><a id="__codelineno-30-7" name="__codelineno-30-7" href="#__codelineno-30-7"></a><span class="c1"># Tracks 1, 3 and 7</span>
|
||||
</span><span id="__span-30-8"><a id="__codelineno-30-8" name="__codelineno-30-8" href="#__codelineno-30-8"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">1</span>,3,7<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-31-1"><a id="__codelineno-31-1" name="__codelineno-31-1" href="#__codelineno-31-1"></a><span class="c1"># Tracks 1 through 8, but not track 4</span>
|
||||
</span><span id="__span-31-2"><a id="__codelineno-31-2" name="__codelineno-31-2" href="#__codelineno-31-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">1</span>-8,-4<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-31-1"><a id="__codelineno-31-1" name="__codelineno-31-1" href="#__codelineno-31-1"></a><span class="c1"># Disc 2, track 3</span>
|
||||
</span><span id="__span-31-2"><a id="__codelineno-31-2" name="__codelineno-31-2" href="#__codelineno-31-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>2x3<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-31-3"><a id="__codelineno-31-3" name="__codelineno-31-3" href="#__codelineno-31-3"></a>
|
||||
</span><span id="__span-31-4"><a id="__codelineno-31-4" name="__codelineno-31-4" href="#__codelineno-31-4"></a><span class="c1"># Disc 2, tracks 1 through 4</span>
|
||||
</span><span id="__span-31-5"><a id="__codelineno-31-5" name="__codelineno-31-5" href="#__codelineno-31-5"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>2x1-2x4<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-31-6"><a id="__codelineno-31-6" name="__codelineno-31-6" href="#__codelineno-31-6"></a>
|
||||
</span><span id="__span-31-7"><a id="__codelineno-31-7" name="__codelineno-31-7" href="#__codelineno-31-7"></a><span class="c1"># Disc 1 track 3, through disc 2 track 2</span>
|
||||
</span><span id="__span-31-8"><a id="__codelineno-31-8" name="__codelineno-31-8" href="#__codelineno-31-8"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>1x3-2x2<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
<div class="tabbed-block">
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-32-1"><a id="__codelineno-32-1" name="__codelineno-32-1" href="#__codelineno-32-1"></a><span class="c1"># Tracks 1 through 8, but not track 4</span>
|
||||
</span><span id="__span-32-2"><a id="__codelineno-32-2" name="__codelineno-32-2" href="#__codelineno-32-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span><span class="m">1</span>-8,-4<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3959,7 +3991,7 @@ the year.</p>
|
||||
<p>A service that only carries this kind of title sets <code>DAILY = True</code> on its class, and a
|
||||
service can set <code>air_date</code> on each episode itself. Add <code>--daily</code> to mark any other title
|
||||
as date-based:</p>
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-32-1"><a id="__codelineno-32-1" name="__codelineno-32-1" href="#__codelineno-32-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--daily<span class="w"> </span>--tvdb<span class="w"> </span><span class="m">73871</span><span class="w"> </span>--enrich<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><pre><span></span><code><span id="__span-33-1"><a id="__codelineno-33-1" name="__codelineno-33-1" href="#__codelineno-33-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--daily<span class="w"> </span>--tvdb<span class="w"> </span><span class="m">73871</span><span class="w"> </span>--enrich<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<p>With <code>--enrich</code> and a TVDB ID, <code>--daily</code> fills in the air date of every episode that has
|
||||
none. An air date the service already set is kept. unshackle skips dates before 1970 and
|
||||
@@ -4041,9 +4073,9 @@ the episode has no parts, rather than quietly handing you the whole episode. Use
|
||||
</tbody>
|
||||
</table>
|
||||
<p>When <code>--latest-episode</code> or <code>--latest-episodes</code> is set, <code>-w</code> has no effect.</p>
|
||||
<div class="language-shell highlight"><span class="filename">Grab just the newest episode</span><pre><span></span><code><span id="__span-33-1"><a id="__codelineno-33-1" name="__codelineno-33-1" href="#__codelineno-33-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--latest-episode<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Grab just the newest episode</span><pre><span></span><code><span id="__span-34-1"><a id="__codelineno-34-1" name="__codelineno-34-1" href="#__codelineno-34-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--latest-episode<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<div class="language-shell highlight"><span class="filename">Grab the three newest episodes</span><pre><span></span><code><span id="__span-34-1"><a id="__codelineno-34-1" name="__codelineno-34-1" href="#__codelineno-34-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--latest-episodes<span class="w"> </span><span class="m">3</span><span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Grab the three newest episodes</span><pre><span></span><code><span id="__span-35-1"><a id="__codelineno-35-1" name="__codelineno-35-1" href="#__codelineno-35-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--latest-episodes<span class="w"> </span><span class="m">3</span><span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<h2 id="including-and-excluding-track-types">Including and excluding track types<a class="headerlink" href="#including-and-excluding-track-types" title="Permanent link">¶</a></h2>
|
||||
<p>You can restrict a download to certain track categories, either positively (only these)
|
||||
@@ -4083,16 +4115,17 @@ video and audio. Add <code>-A</code> or <code>-S</code> for that.</p>
|
||||
<li>A flag that drops the same tracks is an error, for example <code>-ado</code> with <code>--no-audio</code>
|
||||
or <code>-fso</code> with <code>-A</code>.</li>
|
||||
<li>A title with no track of that kind stops a run of one title. A run of more than one
|
||||
title skips that title with a warning and continues.</li>
|
||||
title skips that title with a warning and continues. The run fails when it skips
|
||||
every title.</li>
|
||||
<li>unshackle reads the kind from the manifest or from the service. A track that
|
||||
neither of them marks as descriptive or forced does not match.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="language-shell highlight"><span class="filename">Audio description only, in English</span><pre><span></span><code><span id="__span-35-1"><a id="__codelineno-35-1" name="__codelineno-35-1" href="#__codelineno-35-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-A<span class="w"> </span>-ado<span class="w"> </span>-al<span class="w"> </span>en<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Audio description only, in English</span><pre><span></span><code><span id="__span-36-1"><a id="__codelineno-36-1" name="__codelineno-36-1" href="#__codelineno-36-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-A<span class="w"> </span>-ado<span class="w"> </span>-al<span class="w"> </span>en<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<div class="language-shell highlight"><span class="filename">Subtitles only</span><pre><span></span><code><span id="__span-36-1"><a id="__codelineno-36-1" name="__codelineno-36-1" href="#__codelineno-36-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-S<span class="w"> </span>-sl<span class="w"> </span>en<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Subtitles only</span><pre><span></span><code><span id="__span-37-1"><a id="__codelineno-37-1" name="__codelineno-37-1" href="#__codelineno-37-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-S<span class="w"> </span>-sl<span class="w"> </span>en<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<div class="language-shell highlight"><span class="filename">Everything except chapters</span><pre><span></span><code><span id="__span-37-1"><a id="__codelineno-37-1" name="__codelineno-37-1" href="#__codelineno-37-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-nc<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Everything except chapters</span><pre><span></span><code><span id="__span-38-1"><a id="__codelineno-38-1" name="__codelineno-38-1" href="#__codelineno-38-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-nc<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Note</p>
|
||||
@@ -4128,7 +4161,7 @@ are always kept.</p>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="language-shell highlight"><span class="filename">See the track selection without downloading</span><pre><span></span><code><span id="__span-38-1"><a id="__codelineno-38-1" name="__codelineno-38-1" href="#__codelineno-38-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-q<span class="w"> </span><span class="m">1080</span><span class="w"> </span>-v<span class="w"> </span>H.265<span class="w"> </span>-r<span class="w"> </span>HDR10<span class="w"> </span>--list<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">See the track selection without downloading</span><pre><span></span><code><span id="__span-39-1"><a id="__codelineno-39-1" name="__codelineno-39-1" href="#__codelineno-39-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-q<span class="w"> </span><span class="m">1080</span><span class="w"> </span>-v<span class="w"> </span>H.265<span class="w"> </span>-r<span class="w"> </span>HDR10<span class="w"> </span>--list<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<h2 id="output-and-muxing">Output and muxing<a class="headerlink" href="#output-and-muxing" title="Permanent link">¶</a></h2>
|
||||
<h3 id="output-location-and-folders">Output location and folders<a class="headerlink" href="#output-location-and-folders" title="Permanent link">¶</a></h3>
|
||||
@@ -4138,7 +4171,7 @@ are always kept.</p>
|
||||
<li><code>--no-folder</code>: do not make a per-show folder for TV downloads.</li>
|
||||
<li><code>--no-source</code>: remove the service source tag from the filename and path.</li>
|
||||
</ul>
|
||||
<div class="language-shell highlight"><span class="filename">Send this download somewhere specific</span><pre><span></span><code><span id="__span-39-1"><a id="__codelineno-39-1" name="__codelineno-39-1" href="#__codelineno-39-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-o<span class="w"> </span>~/Videos/incoming<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Send this download somewhere specific</span><pre><span></span><code><span id="__span-40-1"><a id="__codelineno-40-1" name="__codelineno-40-1" href="#__codelineno-40-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-o<span class="w"> </span>~/Videos/incoming<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<h3 id="muxing-behaviour">Muxing behaviour<a class="headerlink" href="#muxing-behaviour" title="Permanent link">¶</a></h3>
|
||||
<p>By default, <code>mkvmerge</code> muxes the tracks of a movie or an episode into a single Matroska
|
||||
@@ -4193,20 +4226,21 @@ window, or the whole file when the track is one file.</p>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Music is never muxed</p>
|
||||
<p>A song skips the muxer. unshackle keeps the container that the service
|
||||
delivered, such as <code>.flac</code>, <code>.m4a</code>, or <code>.mp3</code>, and writes the metadata into that file.
|
||||
<p>A song skips the muxer. unshackle remuxes it into the container of its codec,
|
||||
such as <code>.flac</code>, <code>.m4a</code>, or <code>.mp3</code>, and writes the metadata into that file.
|
||||
Read <a href="../output-and-naming/#music-output-files">Music output files</a>.</p>
|
||||
</div>
|
||||
<h3 id="after-the-download">After the download<a class="headerlink" href="#after-the-download" title="Permanent link">¶</a></h3>
|
||||
<p><code>--postscript "<command>"</code> runs your own command once per output file, with unshackle's
|
||||
metadata substituted into <code>{variable}</code> placeholders. It is repeatable, and it replaces the
|
||||
<code>post_scripts</code> config for that run. No <code>success</code> post-script operates under <code>--no-mux</code>, because
|
||||
that run writes no muxed output. A <code>failure</code> post-script still operates if the download fails.</p>
|
||||
<div class="language-shell highlight"><span class="filename">Hand each finished file to an uploader</span><pre><span></span><code><span id="__span-40-1"><a id="__codelineno-40-1" name="__codelineno-40-1" href="#__codelineno-40-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--postscript<span class="w"> </span><span class="s2">"python /opt/upload.py {filepath} --service={service}"</span><span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
that run writes no muxed output; a song is the exception, because <code>--no-mux</code> does not apply to it.
|
||||
A <code>failure</code> post-script still operates if the download fails.</p>
|
||||
<div class="language-shell highlight"><span class="filename">Hand each finished file to an uploader</span><pre><span></span><code><span id="__span-41-1"><a id="__codelineno-41-1" name="__codelineno-41-1" href="#__codelineno-41-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--postscript<span class="w"> </span><span class="s2">"python /opt/upload.py {filepath} --service={service}"</span><span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<p><code>--no-postscript</code> operates the run with no post-script at all. It silences the <code>post_scripts</code>
|
||||
config and <code>--postscript</code> together, for every event and mode.</p>
|
||||
<div class="language-shell highlight"><span class="filename">Skip the uploader for one run</span><pre><span></span><code><span id="__span-41-1"><a id="__codelineno-41-1" name="__codelineno-41-1" href="#__codelineno-41-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--no-postscript<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Skip the uploader for one run</span><pre><span></span><code><span id="__span-42-1"><a id="__codelineno-42-1" name="__codelineno-42-1" href="#__codelineno-42-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--no-postscript<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<p>For post-scripts that continue across runs, for the <code>season</code> and <code>run</code> modes, for <code>failure</code>
|
||||
post-scripts and for the full variable list, see
|
||||
@@ -4216,16 +4250,16 @@ post-scripts and for the full variable list, see
|
||||
<li><code>--tag</code>: set the release group tag (overrides the configured tag).</li>
|
||||
<li><code>--repack</code>: add a <code>REPACK</code> tag to the output filename.</li>
|
||||
</ul>
|
||||
<div class="language-shell highlight"><span class="filename">Custom group tag and a REPACK label</span><pre><span></span><code><span id="__span-42-1"><a id="__codelineno-42-1" name="__codelineno-42-1" href="#__codelineno-42-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--tag<span class="w"> </span>MYGRP<span class="w"> </span>--repack<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Custom group tag and a REPACK label</span><pre><span></span><code><span id="__span-43-1"><a id="__codelineno-43-1" name="__codelineno-43-1" href="#__codelineno-43-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--tag<span class="w"> </span>MYGRP<span class="w"> </span>--repack<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<h2 id="proxies">Proxies<a class="headerlink" href="#proxies" title="Permanent link">¶</a></h2>
|
||||
<p><code>--proxy</code> accepts a full proxy URI, a country or location code (resolved through your
|
||||
configured proxy providers), or a <code>provider:region</code> form. See
|
||||
<a href="../proxies-and-vpn/#how-proxy-resolution-works">Proxies & VPN</a> for the exact grammar.</p>
|
||||
<div class="language-shell highlight"><span class="filename">Proxy forms</span><pre><span></span><code><span id="__span-43-1"><a id="__codelineno-43-1" name="__codelineno-43-1" href="#__codelineno-43-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--proxy<span class="w"> </span>us<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-43-2"><a id="__codelineno-43-2" name="__codelineno-43-2" href="#__codelineno-43-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--proxy<span class="w"> </span>nordvpn:ca<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-43-3"><a id="__codelineno-43-3" name="__codelineno-43-3" href="#__codelineno-43-3"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--proxy<span class="w"> </span>controld:yul<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-43-4"><a id="__codelineno-43-4" name="__codelineno-43-4" href="#__codelineno-43-4"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--proxy<span class="w"> </span><span class="s1">'http://user:pass@host:8080'</span><span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Proxy forms</span><pre><span></span><code><span id="__span-44-1"><a id="__codelineno-44-1" name="__codelineno-44-1" href="#__codelineno-44-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--proxy<span class="w"> </span>us<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-44-2"><a id="__codelineno-44-2" name="__codelineno-44-2" href="#__codelineno-44-2"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--proxy<span class="w"> </span>nordvpn:ca<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-44-3"><a id="__codelineno-44-3" name="__codelineno-44-3" href="#__codelineno-44-3"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--proxy<span class="w"> </span>controld:yul<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span><span id="__span-44-4"><a id="__codelineno-44-4" name="__codelineno-44-4" href="#__codelineno-44-4"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--proxy<span class="w"> </span><span class="s1">'http://user:pass@host:8080'</span><span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<p>Three related flags:</p>
|
||||
<ul>
|
||||
@@ -4280,20 +4314,20 @@ configured proxy providers), or a <code>provider:region</code> form. See
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="language-shell highlight"><span class="filename">Two tracks at a time, eight threads each</span><pre><span></span><code><span id="__span-44-1"><a id="__codelineno-44-1" name="__codelineno-44-1" href="#__codelineno-44-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--downloads<span class="w"> </span><span class="m">2</span><span class="w"> </span>--workers<span class="w"> </span><span class="m">8</span><span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Two tracks at a time, eight threads each</span><pre><span></span><code><span id="__span-45-1"><a id="__codelineno-45-1" name="__codelineno-45-1" href="#__codelineno-45-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--downloads<span class="w"> </span><span class="m">2</span><span class="w"> </span>--workers<span class="w"> </span><span class="m">8</span><span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<div class="language-shell highlight"><span class="filename">Space out a season download</span><pre><span></span><code><span id="__span-45-1"><a id="__codelineno-45-1" name="__codelineno-45-1" href="#__codelineno-45-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01<span class="w"> </span>--slow<span class="w"> </span><span class="m">30</span>-60<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Space out a season download</span><pre><span></span><code><span id="__span-46-1"><a id="__codelineno-46-1" name="__codelineno-46-1" href="#__codelineno-46-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-w<span class="w"> </span>S01<span class="w"> </span>--slow<span class="w"> </span><span class="m">30</span>-60<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<h2 id="keys-vaults-and-export">Keys, vaults, and export<a class="headerlink" href="#keys-vaults-and-export" title="Permanent link">¶</a></h2>
|
||||
<p>By default, unshackle checks your <strong>key vaults</strong> first and only asks a <strong>CDM</strong> to license
|
||||
a content key when the vault misses. You can force one side or the other:</p>
|
||||
<ul>
|
||||
<li><code>--cdm-only</code>: only use the CDM (skip vaults). Over a <code>server_cdm</code> remote session the flag does not reach the server, whose vault shortcut still runs; it only skips the client's decode check on a server key.</li>
|
||||
<li><code>--cdm-only</code>: only use the CDM (skip vaults). Over <code>--remote</code>, your own CDM licenses each track, and the run uses neither the server CDM nor the server vault. It needs a local CDM, and a remote session on the server's device fails.</li>
|
||||
<li><code>--cdm <name></code>: use the named CDM device for this run, ignoring the <code>cdm</code> config mapping (including its quality and Widevine/PlayReady sub-entries). Over <code>--remote</code>, that device licenses the remote session, not the server CDM.</li>
|
||||
<li><code>--vaults-only</code>: only use key vaults and never license through the CDM. A missing
|
||||
content key fails.</li>
|
||||
</ul>
|
||||
<div class="language-shell highlight"><span class="filename">Fetch keys only, no download</span><pre><span></span><code><span id="__span-46-1"><a id="__codelineno-46-1" name="__codelineno-46-1" href="#__codelineno-46-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--skip-dl<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Fetch keys only, no download</span><pre><span></span><code><span id="__span-47-1"><a id="__codelineno-47-1" name="__codelineno-47-1" href="#__codelineno-47-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--skip-dl<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<p><code>--export</code> writes a <code>mediaexport</code> JSON file into the configured exports directory. It holds
|
||||
the manifest, the DRM init data, the content keys, the KIDs of each track and the title
|
||||
@@ -4302,12 +4336,12 @@ left it, with the ad periods that the service skips. <code>unshackle import</cod
|
||||
a download later, and gives each track only the content keys for its KIDs. The import uses the
|
||||
saved manifest, so it skips the same periods and does not fetch the manifest again. The importer also reads the
|
||||
older unshackle <code>version: 2</code> files and unidl's own export files.</p>
|
||||
<div class="language-shell highlight"><span class="filename">Export track info and keys</span><pre><span></span><code><span id="__span-47-1"><a id="__codelineno-47-1" name="__codelineno-47-1" href="#__codelineno-47-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--skip-dl<span class="w"> </span>--export<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Export track info and keys</span><pre><span></span><code><span id="__span-48-1"><a id="__codelineno-48-1" name="__codelineno-48-1" href="#__codelineno-48-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--skip-dl<span class="w"> </span>--export<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<p>Add <code>--all-drm</code> to get the content keys of each DRM system the title offers. The export then
|
||||
holds the DRM init data of both. A Key Vault that has a content key stops the challenge for
|
||||
its KID; add <code>--cdm-only</code> to send a challenge for each DRM system.</p>
|
||||
<div class="language-shell highlight"><span class="filename">License with Widevine and PlayReady, no download</span><pre><span></span><code><span id="__span-48-1"><a id="__codelineno-48-1" name="__codelineno-48-1" href="#__codelineno-48-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--skip-dl<span class="w"> </span>--all-drm<span class="w"> </span>--export<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">License with Widevine and PlayReady, no download</span><pre><span></span><code><span id="__span-49-1"><a id="__codelineno-49-1" name="__codelineno-49-1" href="#__codelineno-49-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--skip-dl<span class="w"> </span>--all-drm<span class="w"> </span>--export<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<p>The file name tells what the file holds, in the form
|
||||
<code>{title}.{scope}.{resolutions}.{codecs}.{ranges}.{manifests}.{audio}-{SERVICE}.json</code>:</p>
|
||||
@@ -4445,9 +4479,9 @@ lookups but keep the IDs you give, set
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="language-shell highlight"><span class="filename">Force the right IMDb match, and keep the service's own naming</span><pre><span></span><code><span id="__span-49-1"><a id="__codelineno-49-1" name="__codelineno-49-1" href="#__codelineno-49-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--imdb<span class="w"> </span>tt1375666<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Force the right IMDb match, and keep the service's own naming</span><pre><span></span><code><span id="__span-50-1"><a id="__codelineno-50-1" name="__codelineno-50-1" href="#__codelineno-50-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--imdb<span class="w"> </span>tt1375666<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<div class="language-shell highlight"><span class="filename">Force the match and take IMDb's title, year and language too</span><pre><span></span><code><span id="__span-50-1"><a id="__codelineno-50-1" name="__codelineno-50-1" href="#__codelineno-50-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--imdb<span class="w"> </span>tt1375666<span class="w"> </span>--enrich<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Force the match and take IMDb's title, year and language too</span><pre><span></span><code><span id="__span-51-1"><a id="__codelineno-51-1" name="__codelineno-51-1" href="#__codelineno-51-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--imdb<span class="w"> </span>tt1375666<span class="w"> </span>--enrich<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<h3 id="what-each-metadata-provider-supplies">What each metadata provider supplies<a class="headerlink" href="#what-each-metadata-provider-supplies" title="Permanent link">¶</a></h3>
|
||||
<p>Metadata providers differ in what they answer with, so the fields <code>--enrich</code> can replace
|
||||
@@ -4565,7 +4599,7 @@ selection.</p>
|
||||
TVDB's <code>alternate</code> (Streaming) order for Futurama, for example, while TVDB's <code>official</code> order
|
||||
holds back four season-one episodes to the start of season two. <code>--tvdb-order</code> works out which
|
||||
order the service used, then renumbers the episodes into the order you asked for:</p>
|
||||
<div class="language-shell highlight"><span class="filename">Download Futurama in DVD order</span><pre><span></span><code><span id="__span-51-1"><a id="__codelineno-51-1" name="__codelineno-51-1" href="#__codelineno-51-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--tvdb-order<span class="w"> </span>dvd<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Download Futurama in DVD order</span><pre><span></span><code><span id="__span-52-1"><a id="__codelineno-52-1" name="__codelineno-52-1" href="#__codelineno-52-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--tvdb-order<span class="w"> </span>dvd<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<p>Available orders are <code>official</code> (aired), <code>dvd</code>, <code>absolute</code>, <code>alternate</code>, and <code>regional</code>. Set
|
||||
<code>tvdb_order</code> in your config to apply one by default.</p>
|
||||
@@ -4580,7 +4614,7 @@ error and leaves the numbering untouched. Pick an order that covers the whole se
|
||||
<p>Some anime release groups number each season on from the season before it. With
|
||||
<code>--continuous-episodes</code>, a season two that follows a four-episode season one starts at
|
||||
<code>S02E05</code>:</p>
|
||||
<div class="language-shell highlight"><span class="filename">Number season two on from season one</span><pre><span></span><code><span id="__span-52-1"><a id="__codelineno-52-1" name="__codelineno-52-1" href="#__codelineno-52-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-ce<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
<div class="language-shell highlight"><span class="filename">Number season two on from season one</span><pre><span></span><code><span id="__span-53-1"><a id="__codelineno-53-1" name="__codelineno-53-1" href="#__codelineno-53-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>-ce<span class="w"> </span>EXAMPLE<span class="w"> </span><span class="m">81234567</span>
|
||||
</span></code></pre></div>
|
||||
<p>The count comes from the episodes the service lists, so download from the series URL, not
|
||||
from a single season. A season the service does not list in your region is not counted.
|
||||
@@ -4719,7 +4753,7 @@ authoritative list.</p>
|
||||
<tr>
|
||||
<td><code>--worst</code></td>
|
||||
<td></td>
|
||||
<td>Lowest bitrate within <code>-q</code>.</td>
|
||||
<td>Lowest-bitrate video at each requested resolution, or at the lowest resolution if none is set.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>--require-audio</code></td>
|
||||
@@ -4737,6 +4771,11 @@ authoritative list.</p>
|
||||
<td>Degrade gracefully instead of failing.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>--skip-missing</code></td>
|
||||
<td></td>
|
||||
<td>Skip a title that misses a required language or track, and continue with the next title.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>--output</code></td>
|
||||
<td><code>-o</code></td>
|
||||
<td>Output directory for this run.</td>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -1010,6 +1010,17 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#clearkey-over-a-whole-file-aes-ctr" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
ClearKey over a whole file (AES-CTR)
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -2474,6 +2485,17 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#clearkey-over-a-whole-file-aes-ctr" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
ClearKey over a whole file (AES-CTR)
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -2622,7 +2644,7 @@ from the track, asks the CDM for a license challenge, sends that challenge to th
|
||||
service's license server, hands the response back to the CDM to extract the keys, and
|
||||
then decrypts the file with those keys.</p>
|
||||
<h2 id="supported-drm-systems">Supported DRM systems<a class="headerlink" href="#supported-drm-systems" title="Permanent link">¶</a></h2>
|
||||
<p>unshackle implements six DRM systems. Only the first two need a device file and a
|
||||
<p>unshackle implements seven DRM systems. Only the first two need a device file and a
|
||||
license-server handshake. The rest are special cases.</p>
|
||||
<table>
|
||||
<thead>
|
||||
@@ -2670,15 +2692,22 @@ license-server handshake. The rest are special cases.</p>
|
||||
<td>The service gives the per-track key. No CDM, no license server.</td>
|
||||
<td>in-process Blowfish-CBC on every third 2048-byte chunk</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>ClearKey (CTR)</strong>, AES-128-CTR</td>
|
||||
<td>none</td>
|
||||
<td>The service gives the per-track key and IV. No CDM, no license server.</td>
|
||||
<td>in-process AES-CTR over the whole file</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Two different ClearKeys</p>
|
||||
<p>"ClearKey (HLS)" and "ClearKey (CENC)" are entirely different systems that happen
|
||||
to share a name. The HLS variant is the AES-128 content key that an <code>EXT-X-KEY</code>
|
||||
<p class="admonition-title">Three different ClearKeys</p>
|
||||
<p>"ClearKey (HLS)", "ClearKey (CENC)" and "ClearKey (CTR)" are entirely different systems that
|
||||
happen to share a name. The HLS variant is the AES-128 content key that an <code>EXT-X-KEY</code>
|
||||
tag references, and unshackle decrypts it in-process. The CENC variant is the W3C
|
||||
EME <code>org.w3.clearkey</code> scheme. It delivers keys as a JWK Set, and shaka-packager or
|
||||
mp4decrypt decrypts it like Widevine. Neither involves a device file.</p>
|
||||
mp4decrypt decrypts it like Widevine. The CTR variant is one AES-CTR stream over a
|
||||
whole file, with the content key and the IV that the service gives. None of them involves a device file.</p>
|
||||
</div>
|
||||
<h3 id="widevine-vs-playready">Widevine vs PlayReady<a class="headerlink" href="#widevine-vs-playready" title="Permanent link">¶</a></h3>
|
||||
<p>These are the two "real" DRMs, and in unshackle they behave almost identically: the
|
||||
@@ -3021,6 +3050,9 @@ fetches the content key directly (from the given URI or an inline <code>data:</c
|
||||
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
|
||||
automatically during download.</p>
|
||||
<p>The <code>EXT-X-KEY</code> URI must return a content key of exactly 16 bytes, or the download stops with an error.
|
||||
If a decrypted segment has no valid PKCS7 padding, unshackle keeps the output and
|
||||
logs one warning for the track, because the content key is possibly wrong.</p>
|
||||
<h3 id="clearkey-over-cenc-w3c-eme-orgw3clearkey">ClearKey over CENC (W3C EME <code>org.w3.clearkey</code>)<a class="headerlink" href="#clearkey-over-cenc-w3c-eme-orgw3clearkey" title="Permanent link">¶</a></h3>
|
||||
<p>The CENC ClearKey scheme is a proper license flow, but the "license server"
|
||||
returns the keys as a JWK Set and not a DRM-wrapped blob. unshackle builds a W3C
|
||||
@@ -3031,6 +3063,23 @@ EME request of the form:</p>
|
||||
license 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 <code>decryption</code> setting applies.</p>
|
||||
<h3 id="clearkey-over-a-whole-file-aes-ctr">ClearKey over a whole file (AES-CTR)<a class="headerlink" href="#clearkey-over-a-whole-file-aes-ctr" title="Permanent link">¶</a></h3>
|
||||
<p>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 <code>--skip-dl</code> run licenses
|
||||
the content key, so <code>--list</code> 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.</p>
|
||||
<p>Over <code>--remote</code> the track list carries no content key. After the track selection the client asks the server
|
||||
for the content key of each chosen track, and then it decrypts the file itself. The server licenses only for an
|
||||
API key with the <code>server_cdm</code> grant for the service. Without it, or in a remote session on the server's device, the
|
||||
track stops with one error before its download. A decrypted file with another
|
||||
signature raises an error and stays encrypted. A decrypted file in a paged AAC container (<code>SpAC</code>) becomes an
|
||||
<code>.m4a</code> file that declares HE-AACv2 and whose edit list removes the coder delay, so the file has the length of the
|
||||
track. This needs <a href="../../getting-started/installation/#recommended-and-optional-tools">MP4Box</a> on the machine that
|
||||
decrypts, the client over <code>--remote</code>. Without it the file becomes one ADTS stream, which the mux step packs into
|
||||
an <code>.m4a</code> file that keeps the coder delay.</p>
|
||||
<p>The client must know this cipher as well as the server: a client without it drops the DRM entry without a
|
||||
log and saves the encrypted file.</p>
|
||||
<h2 id="widevine-and-playready-on-the-same-title">Widevine and PlayReady on the same title<a class="headerlink" href="#widevine-and-playready-on-the-same-title" title="Permanent link">¶</a></h2>
|
||||
<p>A single manifest can advertise both Widevine and PlayReady. unshackle picks the CDM
|
||||
per track: if a track needs a system that your loaded CDM cannot supply, it
|
||||
@@ -3112,7 +3161,7 @@ control this trade-off on the <code>dl</code> command:</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>--cdm-only</code></td>
|
||||
<td>Ignore vaults for sourcing keys and always perform a fresh license request. Over a <code>server_cdm</code> remote session the server still reads its own vaults; the flag only skips the client's decode check on the key it gets back.</td>
|
||||
<td>Ignore vaults for sourcing keys and always perform a fresh license request. Over <code>--remote</code>, your own CDM licenses each track, and the run uses neither the server CDM nor the server vault. A remote session on the server's device fails, and so does a run with no local CDM.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>--cdm <name></code></td>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -1077,6 +1077,28 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#audio-vivid-output" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
Audio Vivid output
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#3d-output" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
3D output
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -2484,6 +2506,28 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#audio-vivid-output" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
Audio Vivid output
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#3d-output" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
3D output
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -2627,7 +2671,7 @@
|
||||
<li><strong>Output directory</strong>: <code>directories.downloads</code> from your config, or whatever you pass to <code>-o/--output</code> on the command line for a single run.</li>
|
||||
<li><strong>Folder template</strong>: an optional per-title subfolder. unshackle <strong>always</strong> puts TV episodes and songs in a folder. Movies only get one if you define a <code>movies</code> folder template, or a single-string <code>folder</code> template that applies to all title kinds (see <a href="#folder-templates">Folder templates</a>).</li>
|
||||
<li><strong>Filename template</strong>: the <code>output_template</code> for the title kind (movie, series, or song).</li>
|
||||
<li><strong>Extension</strong>: chosen by the muxer for a movie or an episode: <code>.mkv</code> for video, <code>.mka</code> for audio-only, <code>.mks</code> for subtitle-only, <code>.mp4</code> for <a href="#dtsx-profile-2-and-mpeg-h-output">DTS:X Profile 2 and MPEG-H audio</a>. unshackle does not mux a song. It remuxes a song into the container of its codec, such as <code>.flac</code>, <code>.opus</code>, or <code>.m4a</code>. Read <a href="#music-output-files">Music output files</a>.</li>
|
||||
<li><strong>Extension</strong>: chosen by the muxer for a movie or an episode: <code>.mkv</code> for video, <code>.mka</code> for audio-only, <code>.mks</code> for subtitle-only, <code>.mp4</code> for <a href="#dtsx-profile-2-and-mpeg-h-output">DTS:X Profile 2 and MPEG-H audio</a> and <a href="#3d-output">3D video</a>. unshackle does not mux a song. It remuxes a song into the container of its codec, such as <code>.flac</code>, <code>.opus</code>, or <code>.m4a</code>. Read <a href="#music-output-files">Music output files</a>.</li>
|
||||
</ul>
|
||||
<div class="admonition example">
|
||||
<p class="admonition-title">A typical episode path</p>
|
||||
@@ -2785,7 +2829,7 @@ For an episode with no on-screen name, <code>{episode_name?}</code> and its adja
|
||||
<tr>
|
||||
<td><code>hdr</code></td>
|
||||
<td>Dynamic-range label</td>
|
||||
<td><code>HDR</code>, <code>HDR10P</code>, <code>DV</code>, <code>DV.HDR</code>, <code>DV.HDR10P</code>, <code>HLG</code></td>
|
||||
<td><code>HDR</code>, <code>HDR10P</code>, <code>DV</code>, <code>DV.HDR</code>, <code>DV.HDR10P</code>, <code>HDRVivid</code>, <code>HLG</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>hfr</code></td>
|
||||
@@ -2793,6 +2837,11 @@ For an episode with no on-screen name, <code>{episode_name?}</code> and its adja
|
||||
<td><code>HFR</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>3d</code></td>
|
||||
<td>Stereoscopic 3D marker (MV-HEVC video)</td>
|
||||
<td><code>3D</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>edition</code></td>
|
||||
<td>Edition label from the track, if any</td>
|
||||
<td><code>Directors Cut</code></td>
|
||||
@@ -3047,11 +3096,13 @@ standard height near it, such as 1600x900, keeps its own height. <code>dl -q</co
|
||||
<p>Episodes and songs are always foldered. unshackle writes movies directly into the output directory <em>unless</em> you define a <code>movies</code> folder template (or a single-string <code>folder</code> template, which folders every kind). Set one if you want each movie in its own directory.</p>
|
||||
</div>
|
||||
<h2 id="music-output-files">Music output files<a class="headerlink" href="#music-output-files" title="Permanent link">¶</a></h2>
|
||||
<p>A song does not go through the muxer. Music services deliver audio in a fragmented MP4, which is
|
||||
not a music file. Its header states a length of zero, so a player stops after the first fragment.
|
||||
FLAC inside an MP4 is also not a FLAC stream. A rename cannot correct either fault, so unshackle
|
||||
remuxes each downloaded audio track into the container of its codec, then moves the file to its
|
||||
final path.</p>
|
||||
<p>A song does not go through the muxer. Music services deliver audio as a fragmented MP4, a WebM
|
||||
file or a plain audio file, and every download has a <code>.mp4</code> name. A fragmented MP4 header states a
|
||||
length of zero, so a player stops after the first fragment. A rename cannot correct this, so
|
||||
unshackle remuxes each downloaded audio track into the container of its codec, then moves the file
|
||||
to its final path.</p>
|
||||
<p>FFprobe reads the codec from the downloaded file. The codec that the service declares is used only
|
||||
when FFprobe cannot read the file.</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -3065,6 +3116,14 @@ final path.</p>
|
||||
<td><code>.flac</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PCM, integer, 24-bit or less</td>
|
||||
<td><code>.flac</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PCM, more than 24-bit or floating point</td>
|
||||
<td><code>.wav</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Opus</td>
|
||||
<td><code>.opus</code></td>
|
||||
</tr>
|
||||
@@ -3077,13 +3136,24 @@ final path.</p>
|
||||
<td><code>.mp3</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AAC, ALAC, and all other codecs</td>
|
||||
<td>DTS, DTS-HD</td>
|
||||
<td><code>.mka</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AAC, ALAC, Dolby Digital, Dolby Digital Plus, and all other codecs</td>
|
||||
<td><code>.m4a</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>unshackle re-encodes FLAC in this step. The audio does not change, but the new file states its
|
||||
true length. A plain copy cannot, because it keeps the source header and the zero in it.</p>
|
||||
<p>unshackle encodes FLAC and PCM to FLAC in this step. The audio does not change, but the new file
|
||||
states its true length. A plain copy cannot, because it keeps the source header and the zero in it.
|
||||
FLAC cannot hold floating-point PCM, and FFmpeg writes 32-bit FLAC only as an experimental feature,
|
||||
so that audio goes to <code>.wav</code>.</p>
|
||||
<p>FFmpeg writes DTS into MP4 with the wrong codec entry, so DTS goes to Matroska. AC-4, MPEG-H and
|
||||
DTS:X Profile 2 (DTS-UHD) go through MP4Box, because FFmpeg cannot write them into MP4. MP4Box
|
||||
needs <a href="../../getting-started/installation/#recommended-and-optional-tools">GPAC</a>.</p>
|
||||
<p>With <code>--sample</code>, the same step cuts the song to the sample window. If the window starts after the
|
||||
end of the song, unshackle shows a warning and keeps the full download.</p>
|
||||
<p>unshackle writes no <code>.mkv</code> file for music, and the <a href="#muxing-options">muxing options</a> below do not
|
||||
apply.</p>
|
||||
<p>The <code>songs</code> output template names the file. The <code>albums</code> folder template names the folder
|
||||
@@ -3095,12 +3165,17 @@ around it.</p>
|
||||
</span></code></pre></div>
|
||||
<h3 id="music-metadata">Music metadata<a class="headerlink" href="#music-metadata" title="Permanent link">¶</a></h3>
|
||||
<p>After the file moves, unshackle writes the metadata into the audio file. It uses Vorbis
|
||||
comments for FLAC and Ogg, ID3 frames for MP3, and MP4 atoms for M4A. The tags hold the
|
||||
track title, artist, album artist, track and disc numbers, date, genre, ISRC, UPC,
|
||||
copyright, and record label. When <code>tag</code> and <code>tag_group_name</code> are set, unshackle also writes the group
|
||||
name into a <code>GROUP</code> tag.</p>
|
||||
comments for FLAC and Ogg, ID3 frames for MP3 and WAV, MP4 atoms for M4A, and Matroska tags for
|
||||
MKA. The tags hold the track title, artist, album artist, track and disc numbers, date, genre,
|
||||
ISRC, UPC, copyright, and record label. When the service gives them, unshackle also writes each
|
||||
artist of a song with several artists into <code>ARTISTS</code>, and the ReplayGain values into
|
||||
<code>REPLAYGAIN_*</code> tags. An Opus file gets no <code>REPLAYGAIN_*</code> tags, because RFC 7845 advises against
|
||||
them in Opus files. When <code>tag</code> and <code>tag_group_name</code> are set, unshackle also writes the group name
|
||||
into a <code>GROUP</code> tag.</p>
|
||||
<p>unshackle embeds cover art when the service gives an artwork URL. It downloads the image
|
||||
and puts it in the file.</p>
|
||||
and puts it in the file. With no artwork URL, it uses the first image attachment of the song. It
|
||||
converts a WebP image to JPEG. It skips an image larger than 16 MiB, the FLAC limit, with a
|
||||
warning. An MKA file gets no cover art.</p>
|
||||
<p>unshackle writes lyrics when the service supplies them: a <code>LYRICS</code> Vorbis comment for FLAC, a
|
||||
<code>USLT</code> frame for MP3, and a <code>©lyr</code> atom for M4A. Ogg uses the same <code>LYRICS</code> field as
|
||||
FLAC. unshackle does not write synchronized lyrics (<code>SYLT</code>).</p>
|
||||
@@ -3109,9 +3184,9 @@ the audio, for example <code>08.Get.Lucky.lrc</code> next to <code>08.Get.Lucky.
|
||||
the timed lines from that file. The file also comes back to the client from a remote server.</p>
|
||||
<p>A metadata fault does not stop the run. The file is already in place, so unshackle writes a
|
||||
warning and continues.</p>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title"><code>--no-mux</code> leaves music files untagged</p>
|
||||
<p><a href="../cli-reference/#output-muxing-files"><code>--no-mux</code></a> moves each downloaded track file to the output path without the tagging step. A music file from such a run holds only the metadata that the service put in it.</p>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title"><code>--no-mux</code> does not change music output</p>
|
||||
<p>A song has no mux step, so <a href="../cli-reference/#output-muxing-files"><code>--no-mux</code></a> does not apply to it. The song gets the same file name, metadata, cover art and lyrics file as in a run without the flag.</p>
|
||||
</div>
|
||||
<h2 id="muxing-options">Muxing options<a class="headerlink" href="#muxing-options" title="Permanent link">¶</a></h2>
|
||||
<div class="admonition note">
|
||||
@@ -3290,6 +3365,27 @@ Without MP4Box installed the mux stops.</p>
|
||||
<li>SubStation Alpha (<code>.ass</code>) subtitles</li>
|
||||
<li>container tags (<code>mkvpropedit</code>)</li>
|
||||
</ul>
|
||||
<h3 id="audio-vivid-output">Audio Vivid output<a class="headerlink" href="#audio-vivid-output" title="Permanent link">¶</a></h3>
|
||||
<p>No muxer carries Audio Vivid (AVS3-P3): Matroska has no CodecID for it, and FFmpeg and MP4Box cannot
|
||||
write it to MP4. unshackle leaves an Audio Vivid track out of the mux and saves its original MPEG-TS file
|
||||
beside the output, named like a <code>--no-mux</code> audio file (<code><name>.<language>.AV3A.ts</code>).</p>
|
||||
<p>Audio Vivid needs its own decoder, which you supply. unshackle does not ship one. A title whose only
|
||||
tracks are Audio Vivid is not muxed.</p>
|
||||
<h3 id="3d-output">3D output<a class="headerlink" href="#3d-output" title="Permanent link">¶</a></h3>
|
||||
<p>A stereoscopic 3D (MV-HEVC) video track also muxes to MP4 with MP4Box, because Matroska has no
|
||||
mapping for its second view and <code>mkvmerge</code> drops it. There is no 3D Matroska output. unshackle
|
||||
finds a 3D track from the manifest, or from a second video layer in the downloaded file. The MP4
|
||||
title loses the same items as above. For a 3D title, unshackle also:</p>
|
||||
<ul>
|
||||
<li>decrypts the track with mp4decrypt, whatever <a href="../../reference/configuration/drm/#decryption"><code>decryption</code></a> selects</li>
|
||||
<li>writes QuickTime chapters</li>
|
||||
<li>keeps the whole downloaded segments of a <code>--sample</code> run, because the MP4Box cut removes the 3D signalling</li>
|
||||
<li>does not repack the track or rewrite its colour metadata with FFmpeg</li>
|
||||
<li>writes no <code>--include-sample</code> sample, because <code>mkvmerge</code> cuts only Matroska files</li>
|
||||
<li>never uses the track in a <code>HYBRID</code> merge</li>
|
||||
</ul>
|
||||
<p>A Dolby Vision profile 20 track has no HDR10 base layer, so a player without Dolby Vision shows
|
||||
wrong colours.</p>
|
||||
<p>You configure muxing (the combination of video, audio, subtitle, chapter and attachment tracks into a single Matroska file with <code>mkvmerge</code>) under the <code>muxing</code> config key. unshackle muxes only movies and episodes. Read <a href="#music-output-files">Music output files</a> for what a music download does instead.</p>
|
||||
<div class="language-yaml highlight"><span class="filename">unshackle.yaml</span><pre><span></span><code><span id="__span-17-1"><a id="__codelineno-17-1" name="__codelineno-17-1" href="#__codelineno-17-1"></a><span class="nt">muxing</span><span class="p">:</span>
|
||||
</span><span id="__span-17-2"><a id="__codelineno-17-2" name="__codelineno-17-2" href="#__codelineno-17-2"></a><span class="w"> </span><span class="nt">set_title</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
|
||||
@@ -3357,15 +3453,17 @@ Without MP4Box installed the mux stops.</p>
|
||||
</div>
|
||||
<p>A few muxing behaviors are automatic and not configurable:</p>
|
||||
<ul>
|
||||
<li><code>--no-date</code> is always passed for privacy (no timestamps embedded).</li>
|
||||
<li>The output has no encoding date: mkvmerge gets <code>--no-date</code> and MP4Box gets <code>-for-test</code>.</li>
|
||||
<li>Descriptive audio gets the visually-impaired flag. SDH subtitles get the hearing-impaired flag. Forced subtitles get the forced flag.</li>
|
||||
<li>unshackle writes the chapters from the title's chapter list (see <a href="#chapters-naming">Chapters</a> below).</li>
|
||||
</ul>
|
||||
<p>The <code>--no-mux</code> flag skips muxing entirely and writes the individual track files, each with a track-type suffix, into the same output/folder structure.</p>
|
||||
<p>The <code>--no-mux</code> flag skips muxing entirely and writes the individual track files, each with a track-type suffix, into the same output/folder structure. An audio track in an MP4 container gets the <code>.m4a</code> extension. A track that shaka-packager decrypts has its date set to 1970-01-01; other tracks keep the date of the source file.</p>
|
||||
<p>Two output files of one title never get the same name. When a name is already in use, the second file gets the separator of the output template and a number, starting at 2. For example, an audio-description track in the same language and codec as the main audio is saved as <code><name>.en.AAC.2.m4a</code>. With <code>--split-audio</code>, a muxed file whose name is already on disk first gets the name of its audio codec.</p>
|
||||
<h2 id="sample-files">Sample files<a class="headerlink" href="#sample-files" title="Permanent link">¶</a></h2>
|
||||
<p><a href="../cli-reference/#output-muxing-files"><code>--sample</code></a> and <code>--include-sample</code> write a sample into a
|
||||
<code>Sample</code> folder inside the output folder of the title. The sample keeps the filename of the
|
||||
title, with a <code>SAMPLE</code> tag at the end. The tag uses the separator of the output template.</p>
|
||||
title, with a <code>SAMPLE</code> tag at the end. The tag uses the separator of the output template.
|
||||
<code>--include-sample</code> cuts the sample with <code>mkvmerge</code>, so a title that muxes to MP4 gets no sample.</p>
|
||||
<div class="language-text highlight"><span class="filename">A movie with --include-sample</span><pre><span></span><code><span id="__span-18-1"><a id="__codelineno-18-1" name="__codelineno-18-1" href="#__codelineno-18-1"></a>Some.Movie.2026.1080p.EXAMPLE.WEB-DL.H.264-TAG/
|
||||
</span><span id="__span-18-2"><a id="__codelineno-18-2" name="__codelineno-18-2" href="#__codelineno-18-2"></a>├── Some.Movie.2026.1080p.EXAMPLE.WEB-DL.H.264-TAG.mkv
|
||||
</span><span id="__span-18-3"><a id="__codelineno-18-3" name="__codelineno-18-3" href="#__codelineno-18-3"></a>└── Sample/
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -3355,6 +3355,12 @@ Give <code>--remote</code> a proxy the server can reach, or run the service loca
|
||||
machine (a <code>remote_services</code> URL on <code>127.0.0.1</code>) can reach a local proxy, so it is exempt.</p>
|
||||
</div>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Not available on a server</p>
|
||||
<p><code>unshackle serve</code> does not load Gluetun. A REST API request, a download job and a
|
||||
remote session cannot use a <code>gluetun:</code> proxy, also for an API key with <code>server_proxy</code>.
|
||||
Use Gluetun with <code>dl</code> or <code>search</code> on your own machine.</p>
|
||||
</div>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Docker is required</p>
|
||||
<p>Gluetun needs a working <a href="https://docs.docker.com/get-docker/">Docker</a> installation on
|
||||
your <code>PATH</code>. If Docker is not found, the proxy provider fails to load. The container also needs the <code>NET_ADMIN</code> capability and access
|
||||
@@ -3944,20 +3950,12 @@ sure that a username and a password are present (there is no 48-character rule).
|
||||
</tbody>
|
||||
</table>
|
||||
<p>The returned proxy is HTTPS on <strong>port 443</strong>.</p>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Windscribe is not loaded by the REST API resolver</p>
|
||||
<p>The <code>dl</code> command loads the standalone Windscribe proxy provider (and Gluetun), but
|
||||
the proxy resolver that the REST API and the remote-download client use does <strong>not</strong>.
|
||||
If you drive downloads through the API and need Windscribe or Gluetun exits, get the
|
||||
proxy on the CLI side, or use a different proxy provider for API jobs. See the
|
||||
developer note below.</p>
|
||||
</div>
|
||||
<h2 id="developer-notes">Developer notes<a class="headerlink" href="#developer-notes" title="Permanent link">¶</a></h2>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">One resolution path (developers)</p>
|
||||
<p><code>dl</code>, <code>search</code>, the REST API handlers and the remote-service client all load proxy
|
||||
providers through <code>load_proxy_providers()</code> in <code>unshackle/core/proxies/resolve.py</code>.
|
||||
The REST API and the remote-service client call it through
|
||||
The REST API, its download jobs and the remote-service client call it through
|
||||
<code>initialize_proxy_providers()</code>, which leaves out Gluetun because Gluetun starts a
|
||||
local Docker container. All paths accept the same query grammar: a direct URI, a
|
||||
<code>provider:query</code>, a bare query tried against providers in order, or a <code>controld://</code>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2541,6 +2541,12 @@ shown in track listings. The <strong>Extension</strong> column is the file exten
|
||||
<td>TMP</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>SCC</code></td>
|
||||
<td>SCC</td>
|
||||
<td><code>scc</code></td>
|
||||
<td>Scenarist Closed Captions (CEA-608), read only</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>fTTML</code></td>
|
||||
<td>STPP</td>
|
||||
<td><code>stpp</code></td>
|
||||
@@ -2588,6 +2594,13 @@ format-appropriate clean-up to make a single, valid file:</p>
|
||||
output format, unshackle automatically converts any plain TTML track to WebVTT before
|
||||
muxing (the closest lossless equivalent). Boxed <code>fTTML</code> is likewise unwrapped to TTML
|
||||
first.</li>
|
||||
<li><strong>SCC for muxing</strong>: Matroska cannot carry SCC, and no later step can read it. Before
|
||||
muxing, unshackle converts an SCC track straight to the <code>--sub-format</code> you request
|
||||
when that is SRT, WebVTT or TTML, and to SRT in all other cases (no <code>--sub-format</code>,
|
||||
<code>original</code>, or another format, which unshackle then makes from the SRT). Choose
|
||||
<code>--sub-format vtt</code> to keep the caption rows: WebVTT keeps a top-of-screen caption at
|
||||
the top, SRT does not. unshackle reads only the CC1 channel. An SCC file with no CC1
|
||||
captions gives an empty track and a warning.</li>
|
||||
</ul>
|
||||
<p>You normally do not need to think about any of this. It gives a clean file.</p>
|
||||
<h2 id="selecting-and-filtering-subtitles">Selecting and filtering subtitles<a class="headerlink" href="#selecting-and-filtering-subtitles" title="Permanent link">¶</a></h2>
|
||||
@@ -2686,7 +2699,7 @@ It implies <code>-fs</code>, and <code>--s-lang</code> and <code>-fsl</code> sti
|
||||
</span></code></pre></div>
|
||||
<p><code>-fso</code> does not drop video or audio. Add <code>-S</code> for a subtitle-only download. A title with
|
||||
no forced track stops a run of one title. A run of more than one title skips that title
|
||||
with a warning.</p>
|
||||
with a warning, and fails when it skips every title.</p>
|
||||
<h2 id="track-types-forced-sdh-and-cc">Track types: forced, SDH, and CC<a class="headerlink" href="#track-types-forced-sdh-and-cc" title="Permanent link">¶</a></h2>
|
||||
<p>Every subtitle track carries flags describing what kind of captions it holds. These
|
||||
flags drive selection, sort order, output filenames, and the Matroska track flags.</p>
|
||||
@@ -2909,8 +2922,9 @@ styling that survives. <code>—</code> means that the backend cannot convert th
|
||||
</table>
|
||||
<p>Reading the table:</p>
|
||||
<ul>
|
||||
<li><strong>Keep the original</strong>: leaving <code>--sub-format</code> unset (or set to <code>original</code>) never
|
||||
round-trips the file, so every style survives. Only convert when your player cannot
|
||||
<li><strong>Keep the original</strong>: leaving <code>--sub-format</code> unset (or set to <code>original</code>) does not
|
||||
round-trip the file, so every style survives. TTML and SCC are the exceptions, as noted
|
||||
above. Only convert when your player cannot
|
||||
read the source format.</li>
|
||||
<li><strong><code>subtitleedit</code></strong> (SubtitleEdit / <code>seconv</code>): the best choice for anything → SRT. It
|
||||
is the only backend that carries colour, and it embeds <code>{\an8}</code> tags to preserve
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2396,6 +2396,7 @@
|
||||
</div>
|
||||
<h2 id="how-lookups-and-caching-work">How lookups and caching work<a class="headerlink" href="#how-lookups-and-caching-work" title="Permanent link">¶</a></h2>
|
||||
<p>When unshackle needs a content key during a download it asks your vaults <strong>in the order they appear in your config</strong>. It returns the first non-null key it finds and stops searching. If a vault raises a permission error or is unreachable, unshackle skips it and continues the search with the next one.</p>
|
||||
<p>A track needs no licence when a vault holds the content key of the KID that encrypts it. The DRM header of the track can name more KIDs, for example those of other tracks. Before the decrypt, unshackle reads the downloaded file, and licenses each of those KIDs that the file uses and no vault holds. When unshackle cannot read which KIDs the file uses, it licenses all of them.</p>
|
||||
<p>When unshackle recovers new keys from a license, it pushes them to <strong>all</strong> configured vaults, so every vault gradually converges on the same set of keys. Two rules apply to pushing:</p>
|
||||
<ul>
|
||||
<li>unshackle skips keys that already exist in a vault (it never overwrites or deletes existing data).</li>
|
||||
@@ -2439,7 +2440,7 @@
|
||||
<p>Network-backed vaults (<code>HTTP</code> and <code>API</code>) accept an optional per-vault <code>timeout</code> in seconds. If you omit it, unshackle injects the global default:</p>
|
||||
<div class="language-yaml highlight"><span class="filename">unshackle.yaml</span><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="nt">vault_timeout</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">10.0</span><span class="w"> </span><span class="c1"># default, in seconds</span>
|
||||
</span></code></pre></div>
|
||||
<p>A <code>timeout</code> set inline on an individual vault always wins over this global value. The <code>SQLite</code> and <code>MySQL</code> backends do not take a <code>timeout</code> field. <code>MySQL</code> uses <code>vault_timeout</code> as its <code>connect_timeout</code> instead, and falls back to the pymysql default of 10 seconds when <code>vault_timeout</code> is <code>0</code>. To use a different connect timeout, set <code>connect_timeout</code> on the vault.</p>
|
||||
<p>A <code>timeout</code> set inline on an individual vault always wins over this global value. The <code>SQLite</code> and <code>MySQL</code> backends do not take a <code>timeout</code> field. <code>MySQL</code> uses <code>vault_timeout</code> as its <code>connect_timeout</code>, <code>read_timeout</code> and <code>write_timeout</code> instead, and falls back to 10 seconds when <code>vault_timeout</code> is <code>0</code>. To use a different value, set that field on the vault.</p>
|
||||
<p>unshackle pushes content keys to all vaults at the same time, so one slow or unreachable vault costs only its own timeout and does not delay the others.</p>
|
||||
<hr />
|
||||
<h2 id="sqlite-backend">SQLite backend<a class="headerlink" href="#sqlite-backend" title="Permanent link">¶</a></h2>
|
||||
@@ -2547,7 +2548,8 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Any additional fields you provide (such as <code>password</code>, <code>port</code>, or <code>ssl</code>) are passed straight through to <code>pymysql.connect</code>, so you can use the full range of its connection options.</p>
|
||||
<p>Any additional fields you provide (such as <code>password</code>, <code>port</code>, or <code>ssl</code>) are passed straight through to <code>pymysql.connect</code>, so you can use the full range of its connection options. The one exception is <code>autocommit</code>, which is always on.</p>
|
||||
<p>Each <code>MySQL</code> vault keeps one connection open for the whole run and shares it between threads. If the server is down, unshackle skips the vault for the rest of the run.</p>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Account security is on you, not on unshackle</p>
|
||||
<p>unshackle enforces none of this. It is operational policy for a database that may be shared with a group. Never connect with the <code>root</code> account, not even for yourself. Give every account a password, and never let two users share a username/password. Restrict each account's access to only the <code>unshackle</code> database, and grant normal users only <code>SELECT</code> and <code>INSERT</code>. Reserve the <code>CREATE</code> grant for a single trusted user who bootstraps the service tables (see <a href="#kv-prepare-pre-create-service-tables"><code>kv prepare</code></a>); everyone else can insert new keys but should not be creating tables.</p>
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2139,7 +2139,7 @@ at a title and it will:</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Video</td>
|
||||
<td>AVC, HEVC, VC-1, VP8, VP9, AV1; SDR, HLG, HDR10, HDR10+, Dolby Vision, and Dolby Vision <strong>hybrid</strong> merging</td>
|
||||
<td>AVC, HEVC, VC-1, VP8, VP9, AV1; SDR, HLG, HDR10, HDR10+, HDR Vivid, Dolby Vision, and Dolby Vision <strong>hybrid</strong> merging</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Audio</td>
|
||||
|
||||
BIN
Binary file not shown.
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
|
||||
+454
-739
File diff suppressed because it is too large
Load Diff
+1375
-1119
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
|
||||
+635
-151
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2312,7 +2312,7 @@ default. In other words, config only fills in options you did not set on the com
|
||||
<td><code>range</code></td>
|
||||
<td>list</td>
|
||||
<td><code>["SDR"]</code></td>
|
||||
<td>Colour range(s): <code>SDR</code>, <code>HLG</code>, <code>HDR10</code>, <code>HDR10P</code>, <code>DV</code>, <code>HYBRID</code>.</td>
|
||||
<td>Colour range(s): <code>SDR</code>, <code>HLG</code>, <code>HDR10</code>, <code>HDR10P</code>, <code>VIVID</code>, <code>DV</code>, <code>HYBRID</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>channels</code></td>
|
||||
@@ -2399,6 +2399,12 @@ default. In other words, config only fills in options you did not set on the com
|
||||
<td>Warn instead of failing when a requested resolution, range, video language, or audio language is missing, or when one DRM system does not license under <code>--all-drm</code>. The CLI flag is <code>--best-available</code>, also spelled <code>--warn-only</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>skip_missing</code></td>
|
||||
<td>bool</td>
|
||||
<td><code>false</code></td>
|
||||
<td>Skip a title that misses a required language (<code>require_audio</code>, <code>require_video</code>, <code>require_subs</code>) or a track that a filter asks for, and continue with the next title. A run with one title, or a run that skips every title, still fails. The CLI flag is <code>--skip-missing</code>. For REST API jobs, set it in the <a href="../services/#serve"><code>serve</code></a> block.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>generate_dv</code></td>
|
||||
<td>bool</td>
|
||||
<td><code>false</code></td>
|
||||
@@ -2508,11 +2514,12 @@ is the same either way.</p>
|
||||
the next segment it needs and appends every segment that is ready in order, then deletes the
|
||||
segment file. With <a href="../drm/#decrypt_segments"><code>decrypt_segments</code></a> also on, each segment is
|
||||
appended after its decryption completes, never before.</p>
|
||||
<p>This option is off by default because it disables resume, and because its cost during the
|
||||
download is not measured. The append reads each segment straight after a worker wrote it, so
|
||||
the read usually comes from the page cache. On a hard disk, the append to one file while the
|
||||
workers write many segment files can still make the head seek. If a download gets slower with
|
||||
the option on, turn it off.</p>
|
||||
<p>This option is off by default because it disables resume. In a measurement of a 3 GiB track in
|
||||
1500 segments with 16 workers, on an SSD and a loopback server, the merge during the download took
|
||||
0.9 s more than the merge after it on Linux and 1.1 s less on Windows. With each connection limited
|
||||
to 8 MiB/s, it took 2.2 s less on Linux and 8.0 s less on Windows. On a hard disk, the append to one
|
||||
file while the workers write many segment files can make the head seek. If a download gets slower
|
||||
with the option on, turn it off.</p>
|
||||
<p>This applies to video and audio tracks from DASH, ISM, and HLS. An HLS track qualifies
|
||||
only when every segment shares one init segment and one <code>EXT-X-KEY</code>, with no
|
||||
<code>EXT-X-DISCONTINUITY</code>, and the DRM is Widevine, PlayReady, or none. AES-128 tracks, tracks
|
||||
@@ -2976,6 +2983,12 @@ probes the two highest and the two lowest bitrates first:</p>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>The probe also finds HDR Vivid in HEVC HDR10 and HLG tracks. A track becomes <code>VIVID</code>, so
|
||||
<code>-r VIVID</code> selects it, when its first frame carries CUVA HDR Vivid metadata, or when its MPEG-TS
|
||||
program map table (PMT) has the <code>cuvv</code> registration. An HLG track never becomes <code>HDR10P</code>. An audio
|
||||
track with no codec gets its codec from the PMT of an MPEG-TS first segment: the <code>AVSA</code>
|
||||
registration or <code>stream_type</code> <code>0xD5</code> gives <code>Audio Vivid</code>. The probe has no HDR10+ result for an
|
||||
MPEG-TS track.</p>
|
||||
<p>A probe that fails, or a fragment whose metadata is encrypted, keeps the label from the service.
|
||||
unshackle does not probe ISM tracks. Each probe makes one to three small requests: the 64 KiB
|
||||
fragment, plus the playlist of an HLS track or the header of a one-file track. The probes run in
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2146,6 +2146,8 @@ a <code>widevine</code> or <code>playready</code> sub-entry, or a profile or <co
|
||||
that selects only by quality, or only for a different profile, loads no device when the run
|
||||
starts. When <code>server_cdm</code> is unset, unshackle then shows a warning, and the server decides who
|
||||
licenses the remote session.
|
||||
On a server, an API key can replace the entry for a service with its own (see
|
||||
<a href="../services/#serve"><code>serve</code></a>).
|
||||
With only the top-level <code>default</code> entry, the server CDM licenses when the API key has it. Set
|
||||
<code>server_cdm: true</code> on the server entry to keep a per-service entry for local runs only. See
|
||||
<a href="../services/#remote_services"><code>remote_services</code></a>.</p>
|
||||
@@ -2174,7 +2176,8 @@ does not set the order.</p>
|
||||
<p>On a server, an entry that holds <code>widevine</code> and <code>playready</code> gives a remote session the server CDM
|
||||
of the DRM system of the client's local CDM. The service then makes its manifest for that system,
|
||||
so the client's vault keys and its own device apply to the tracks. A client with no local CDM gets
|
||||
the device that the entry lists first.</p>
|
||||
the device that the entry lists first. A service option that runs the remote session on the server's
|
||||
device, such as a server-identity flag, always gets the device that the entry lists first.</p>
|
||||
<p>A quality key can also hold a dict of <code>widevine</code> / <code>playready</code> devices, and so can the
|
||||
top-level <code>default</code> entry:</p>
|
||||
<div class="language-yaml highlight"><pre><span></span><code><span id="__span-2-1"><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="nt">cdm</span><span class="p">:</span>
|
||||
@@ -2386,6 +2389,9 @@ case-insensitively. <code>"mp4decrypt"</code> selects Bento4's mp4decrypt, and <
|
||||
(including <code>"shaka"</code>) selects shaka-packager. When the value is a dict, unshackle compares the
|
||||
service tag case-insensitively and uses the <code>default</code> entry as the fallback.</p>
|
||||
<p>unshackle decrypts HLS AES-128 ClearKey in-process and ignores this setting.</p>
|
||||
<p>unshackle decrypts a stereoscopic 3D (MV-HEVC) track with mp4decrypt whatever this setting says.
|
||||
shaka-packager refuses its Dolby Vision configuration (version 3), and before v3.5.0 it also drops
|
||||
the boxes of the second view.</p>
|
||||
<p>mp4decrypt finds a content key by the KID in the first <code>sinf</code> box of the track. When that box
|
||||
has no CENC <code>tenc</code> (for example, a PIFF <code>sinf</code> before the CENC one), unshackle also gives
|
||||
mp4decrypt the content key of that KID by track ID. When mp4decrypt copies a track through
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2025,7 +2025,7 @@ default.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="misc/#appearance">Appearance</a></td>
|
||||
<td><code>theme</code></td>
|
||||
<td><code>theme</code>, <code>wide_output</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="misc/#logging-privacy-debug">Logging, privacy & debug</a></td>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2393,6 +2393,12 @@ result in <code>directories.cache/update_check.json</code>.</p>
|
||||
<td><code>catppuccin-mocha</code></td>
|
||||
<td>Named colour theme for all CLI output: banner, logs, progress bars, and help screens. One of <code>catppuccin-mocha</code> (aliases <code>default</code>, <code>catppuccin</code>, <code>mocha</code>), <code>dracula</code>, <code>nord</code>, <code>gruvbox</code>, <code>one-dark</code> (alias <code>onedark</code>), <code>tokyo-night</code> (alias <code>tokyonight</code>), <code>monokai</code>, <code>flexoki</code>, <code>solarized-dark</code> (alias <code>solarized</code>). Case-insensitive; underscores work in place of hyphens. Unknown names fall back to the default with a warning. Preview them all with <code>unshackle env theme</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>wide_output</code></td>
|
||||
<td>bool</td>
|
||||
<td><code>false</code></td>
|
||||
<td>Print the <code>dl</code> title and track listings at the terminal width. When <code>false</code>, they fold at 80 columns, the width that logs and progress bars always use.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr />
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2128,7 +2128,7 @@
|
||||
<td><code>read_timeout</code></td>
|
||||
<td>int</td>
|
||||
<td><code>30</code></td>
|
||||
<td>Read timeout in seconds (max gap between response chunks).</td>
|
||||
<td>Read timeout in seconds (max gap between response chunks). Applies to every request of an rnet session, segment downloads included.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>timeout</code></td>
|
||||
@@ -2350,8 +2350,9 @@ providers and their exit ports:</p>
|
||||
</table>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Provider loading differs between CLI and REST server</p>
|
||||
<p>The <code>dl</code> CLI loads all providers, including <code>gluetun</code>. The REST API / remote-client path
|
||||
does <strong>not</strong> load <code>gluetun</code>, because it starts a local Docker container. ExpressVPN and ProtonVPN also auto-load when their cached session exists, and Hola
|
||||
<p>The <code>dl</code> and <code>search</code> commands load all providers, including <code>gluetun</code>. A server (REST API
|
||||
requests, download jobs and remote sessions) and the remote client do <strong>not</strong> load <code>gluetun</code>,
|
||||
because it starts a local Docker container. ExpressVPN and ProtonVPN also auto-load when their cached session exists, and Hola
|
||||
auto-loads whenever the <code>hola-proxy</code> binary is present.</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2143,7 +2143,7 @@ folder-kind keys.</p>
|
||||
<code>absolute</code>, <code>date</code>, <code>quality</code>, <code>resolution</code>, <code>source</code>, <code>tag</code>, <code>track_number</code>, <code>artist</code>,
|
||||
<code>album_artist</code>, <code>album</code>, <code>disc</code>, <code>track_total</code>, <code>disc_total</code>, <code>release_type</code>, <code>genre</code>,
|
||||
<code>explicit</code>, <code>isrc</code>, <code>upc</code>, <code>label</code>, <code>audio</code>, <code>audio_channels</code>, <code>audio_full</code>, <code>atmos</code>,
|
||||
<code>dual</code>, <code>multi</code>, <code>dubbed</code>, <code>video</code>, <code>hdr</code>, <code>hfr</code>, <code>edition</code>, <code>repack</code>, <code>lang_tag</code>,
|
||||
<code>dual</code>, <code>multi</code>, <code>dubbed</code>, <code>video</code>, <code>hdr</code>, <code>hfr</code>, <code>3d</code>, <code>edition</code>, <code>repack</code>, <code>lang_tag</code>,
|
||||
<code>title_type</code>.</p>
|
||||
</details>
|
||||
<div class="admonition warning">
|
||||
@@ -2261,7 +2261,7 @@ order and the first match wins. If no rule matches, the global <code>tag</code>
|
||||
<li>A value can be a scalar or a list. A list matches if <strong>any</strong> entry matches.</li>
|
||||
<li>Comparison is case-insensitive string equality.</li>
|
||||
<li>The keys of <code>when</code> are the filename template variables for the release itself:
|
||||
<code>title_type</code>, <code>quality</code>, <code>resolution</code>, <code>source</code>, <code>video</code>, <code>hdr</code>, <code>hfr</code>, <code>audio</code>,
|
||||
<code>title_type</code>, <code>quality</code>, <code>resolution</code>, <code>source</code>, <code>video</code>, <code>hdr</code>, <code>hfr</code>, <code>3d</code>, <code>audio</code>,
|
||||
<code>audio_channels</code>, <code>audio_full</code>, <code>atmos</code>, <code>dual</code>, <code>multi</code>, <code>dubbed</code>, <code>edition</code>, <code>repack</code>,
|
||||
and <code>lang_tag</code>. Only these are available. unshackle adds the title's own fields (<code>title</code>,
|
||||
<code>year</code>, <code>season</code>, <code>episode</code>, and so on) after it evaluates the rules, so a condition cannot
|
||||
@@ -2276,8 +2276,8 @@ order and the first match wins. If no rule matches, the global <code>tag</code>
|
||||
an HDR10 base layer gives <code>DV.HDR</code>, and with an HDR10+ base layer <code>DV.HDR10P</code>. Plain <code>DV</code>
|
||||
does <strong>not</strong> match those. Name every variant you want, as the example above does. Note
|
||||
also that HDR10 gives <code>HDR</code>, not <code>HDR10</code>, and so does a PQ video track with no HDR10
|
||||
metadata. The full set of values is <code>HDR</code>, <code>HDR10P</code>, <code>DV</code>, <code>DV.HDR</code>, <code>DV.HDR10P</code>, and
|
||||
<code>HLG</code>, as listed in the
|
||||
metadata. The full set of values is <code>HDR</code>, <code>HDR10P</code>, <code>DV</code>, <code>DV.HDR</code>, <code>DV.HDR10P</code>,
|
||||
<code>HDRVivid</code>, and <code>HLG</code>, as listed in the
|
||||
<a href="../../../guide/output-and-naming/#template-variables">variable table</a>.</p>
|
||||
</div>
|
||||
<h3 id="operators">Operators<a class="headerlink" href="#operators" title="Permanent link">¶</a></h3>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2516,7 +2516,7 @@ values.</p>
|
||||
<td>As in the filename template: <code>{season_episode}</code> keeps the part suffix (<code>S01E05.Part.1</code>) while <code>{episode}</code> drops it</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>{quality}</code> <code>{resolution}</code> <code>{hdr}</code> <code>{hfr}</code> <code>{vcodec}</code> <code>{acodec}</code> <code>{edition}</code> <code>{tag}</code> <code>{lang_tag}</code></td>
|
||||
<td><code>{quality}</code> <code>{resolution}</code> <code>{hdr}</code> <code>{hfr}</code> <code>{3d}</code> <code>{vcodec}</code> <code>{acodec}</code> <code>{edition}</code> <code>{tag}</code> <code>{lang_tag}</code></td>
|
||||
<td>As in the filename template, for this file</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -2543,7 +2543,7 @@ string as absent. Write your script to accept an empty value for every variable.
|
||||
music has none of them.</li>
|
||||
<li><strong>The naming context renders it empty on purpose.</strong> <code>{hdr}</code> is empty for an SDR
|
||||
file, because SDR is the absence of an HDR tag in a filename rather than a tag that
|
||||
reads <code>SDR</code>. <code>{edition}</code>, <code>{atmos}</code>, <code>{multi}</code>, <code>{dual}</code> and <code>{hfr}</code> behave the same
|
||||
reads <code>SDR</code>. <code>{edition}</code>, <code>{atmos}</code>, <code>{multi}</code>, <code>{dual}</code>, <code>{hfr}</code> and <code>{3d}</code> behave the same
|
||||
way. If your script needs the word <code>SDR</code>, derive it from an empty <code>{hdr}</code> yourself.</li>
|
||||
<li>The post-script is a <code>failure</code> one. A failed download has no output file to read metadata
|
||||
from, so everything that comes from the output file is empty. See
|
||||
@@ -2664,6 +2664,9 @@ copy of the sidecar files, and each invocation lists the copies sitting beside i
|
||||
finishes. With <code>-w S01-S02</code> the S01 post-script runs while S02 is still downloading. It says
|
||||
nothing about whether the season is complete on disk. Downloading a single episode fires
|
||||
the post-script for that season as soon as the episode lands.</p>
|
||||
<p>A title that track selection skips (<code>--skip-missing</code>, <code>-ado</code>, <code>-fso</code>) counts as done. The
|
||||
<code>season</code> post-script still fires for the episodes that landed, so the folder can be missing
|
||||
the skipped episodes. A run that skips every title fails, and then no <code>season</code> post-script fires.</p>
|
||||
<p>A title that fails stops the whole run. unshackle dispatches the <code>failure</code> post-script for
|
||||
that title and then returns. It downloads no further title, and no <code>season</code> or <code>run</code>
|
||||
post-script fires after that point. This applies to every title type. If one episode of S01
|
||||
@@ -2767,7 +2770,8 @@ environment variable inside your script rather than putting it in the <code>comm
|
||||
<h2 id="limitations">Limitations<a class="headerlink" href="#limitations" title="Permanent link">¶</a></h2>
|
||||
<ul>
|
||||
<li>No <code>success</code> post-script operates under <code>--no-mux</code> or <code>--skip-dl</code>, because neither writes a
|
||||
muxed output. A <code>failure</code> post-script still runs under <code>--no-mux</code> if the download itself fails.</li>
|
||||
muxed output. A song is the exception: <code>--no-mux</code> does not apply to it, so its post-scripts
|
||||
operate. A <code>failure</code> post-script still runs under <code>--no-mux</code> if the download itself fails.</li>
|
||||
<li><code>failure</code> post-scripts only operate in <code>file</code> mode.</li>
|
||||
<li>There is no webhook sender. Call <code>curl</code> from a script instead.</li>
|
||||
<li>Script output is not captured. Redirect it inside your own script if you want a log.</li>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2099,12 +2099,13 @@
|
||||
<ul>
|
||||
<li><strong>Type:</strong> <code>dict</code> keyed by service tag · <strong>Default:</strong> <code>{}</code></li>
|
||||
</ul>
|
||||
<p>Per-service configuration, keyed by the canonical service tag (for example <code>EXAMPLE1</code>, <code>EXAMPLE2</code>,
|
||||
<p>Per-service configuration, keyed by the service tag in any case (for example <code>EXAMPLE1</code>, <code>EXAMPLE2</code>,
|
||||
<code>EXAMPLE3</code>). unshackle reads several well-known sub-keys out of each service's block:</p>
|
||||
<ul>
|
||||
<li><strong><code>proxy_map</code></strong>: remaps the region query you passed to <code>-p/--proxy</code> for this service.
|
||||
A config key is that query, or <code>"provider:query"</code> when the flag also named a proxy provider. The value is
|
||||
the query asked of the proxy provider instead. It has no effect when you give <code>-p</code> a full proxy URL.</li>
|
||||
the query asked of the proxy provider instead. It has no effect when you give <code>-p</code> a full proxy URL.
|
||||
<code>dl</code>, <code>search</code> and a REST API download job apply it. The other REST API routes and a <code>--remote</code> remote session do not.</li>
|
||||
<li><strong><code>title_map</code></strong>: an exact-match rename map applied to fetched titles (source name →
|
||||
desired name), so a service that names a title differently from your library still matches.</li>
|
||||
<li><strong><code>dl</code></strong>: per-service download defaults, using the same keys as the global
|
||||
@@ -2210,7 +2211,8 @@ your choice, and with a service option that runs the remote session on the serve
|
||||
<p><code>auth_headers</code> lists extra header names to send the API key in, tried before the defaults
|
||||
<code>X-Secret-Key</code> and <code>X-Api-Key</code>, which unshackle always appends as fallbacks. It sends the
|
||||
first name. If the server answers <code>401</code>, it retries the same request with the next name, and
|
||||
keeps the one that works for the rest of the HTTP session. Names you give keep your spelling and
|
||||
keeps the one that works for the rest of the HTTP session. After a request succeeds, a <code>401</code>
|
||||
no longer moves the API key to another name. Names you give keep your spelling and
|
||||
are not repeated in the fallbacks, so unshackle tries
|
||||
<code>auth_headers: ["Authorization", "x-secret-key"]</code> as <code>Authorization</code>, <code>x-secret-key</code>, <code>X-Api-Key</code>.</p>
|
||||
<p><code>timeout</code> is the time in seconds that the client waits for data from the server. The
|
||||
@@ -2276,7 +2278,7 @@ is the <a href="../../../dev/rest-api/">REST API</a> section. These are the conf
|
||||
<td><code>dashboard</code></td>
|
||||
<td>dict</td>
|
||||
<td><em>(unset)</em></td>
|
||||
<td>Developer dashboard: <code>key</code> is the API key for the read-only <code>/api/dashboard/</code> endpoints (status, remote sessions, remote session logs, jobs, keys, services, health, logs, SSE events). Unset leaves those routes unregistered. See <a href="../../../dev/rest-api/dashboard/">dashboard endpoints</a>.</td>
|
||||
<td>Developer dashboard: <code>key</code> is the API key for the read-only <code>/api/dashboard/</code> endpoints (status, remote sessions, remote session logs, jobs, keys, services, health, logs, SSE events). Unset leaves those routes unregistered, and a reload that removes the key makes them answer <code>404</code>. See <a href="../../../dev/rest-api/dashboard/">dashboard endpoints</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>session_ttl</code></td>
|
||||
@@ -2288,7 +2290,7 @@ is the <a href="../../../dev/rest-api/">REST API</a> section. These are the conf
|
||||
<td><code>max_sessions</code></td>
|
||||
<td>int or null</td>
|
||||
<td><code>100</code></td>
|
||||
<td>Maximum concurrent remote sessions; at the cap the server evicts the oldest. Set it to <code>null</code> or <code>0</code> for no limit, which is also what <code>/api/dashboard/status</code> then reports, so a dashboard can tell "no cap" from a cap that happens to sit at the default.</td>
|
||||
<td>Maximum concurrent remote sessions; at the cap the server evicts the oldest remote session of the API key that holds the most. Set it to <code>null</code> or <code>0</code> for no limit, which is also what <code>/api/dashboard/status</code> then reports, so a dashboard can tell "no cap" from a cap that happens to sit at the default.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>history_limit</code></td>
|
||||
@@ -2365,8 +2367,10 @@ the whole file again, globs the device directories again, and swaps in the new <
|
||||
<code>tiers</code>, <code>services</code> and device lists in one step. Open CDM sessions and remote sessions
|
||||
continue; an API key you removed gets <code>401</code> on its next request. A file that does not parse
|
||||
or validate keeps the running settings and logs the reason. A change to <code>remote_only</code>,
|
||||
<code>services_refresh_interval</code>, the first PlayReady device, or any command-line flag needs
|
||||
a restart, and the log says so. A new <code>global_speed_limit</code> applies to jobs that start after the
|
||||
<code>services_refresh_interval</code>, the first PlayReady device, a <code>dashboard.key</code> on a server that
|
||||
started without one, or any command-line flag needs a restart, and the log says so. A reload
|
||||
that removes <code>dashboard.key</code> closes the dashboard: its routes answer <code>404</code> and an open
|
||||
<code>/api/dashboard/events</code> connection ends. A new <code>global_speed_limit</code> applies to jobs that start after the
|
||||
reload; running jobs keep their share. Windows has no <code>SIGHUP</code>: restart the server there.</p>
|
||||
</div>
|
||||
<p><code>server_cdm</code> decides whether the server runs the CDM licensing for that API key. Set it to
|
||||
@@ -2400,19 +2404,52 @@ the remote client's <code>-q</code> when the remote session starts:</p>
|
||||
error. The server checks the values the job runs with, after it applies the service defaults
|
||||
and the <code>serve:</code> download defaults.</li>
|
||||
</ul>
|
||||
<p>The limit protects the server's device, not the content keys. For a Widevine track, a server vault
|
||||
still supplies a content key at every height. A PlayReady track never reads the vault, so above
|
||||
the limit it always goes to the client's device. A licence for a lower track can carry the
|
||||
<p>The limit protects the server's device, not the content keys. A server vault still supplies a
|
||||
content key at every height: for a Widevine track, the key of the track's own KID or of every KID in
|
||||
its header; for a PlayReady track, only the key of the track's own KID. A PlayReady track whose
|
||||
own KID the server does not know always goes to the client's device above the limit. A licence for a lower track can carry the
|
||||
content key of a higher track when the service shares one content key between them. With server
|
||||
accounts enabled, a client that reports a stronger device than it holds makes the server's
|
||||
account request those manifests; the licence server still refuses its challenge.</p>
|
||||
<p><code>server_vault</code> lets a remote session that the client's own device licenses take content keys
|
||||
from the server vault. Set it to <code>true</code> for every service, or to a list of service tags. It is
|
||||
<code>false</code> unless the entry sets it, and <code>server_cdm</code> for a service implies it. The server looks up
|
||||
every KID of the track in its vault and makes no live licence. A track that the vault does not
|
||||
the track's own KID in its vault, or every KID of the track when it does not know that KID, and
|
||||
makes no live licence. A track that the vault does not
|
||||
hold goes back to the client's device. When the service runs the remote session on the server's
|
||||
own device (a service option, such as a server-identity flag), the client's own vaults, and the
|
||||
server vault with this grant, are the only source, and a missing content key stops the download.</p>
|
||||
<p><code>cdm</code> gives the API key its own CDM device for a service. It maps a service tag to a device
|
||||
name, or to <code>widevine</code>, <code>playready</code> and <code>default</code> sub-entries that name a device for each DRM
|
||||
system. Per-profile sub-entries and a <code>default</code> service tag are not available here: name each
|
||||
service tag. The entry replaces the whole top-level <a href="../drm/#cdm"><code>cdm</code></a> entry for that service,
|
||||
both for the device the service sees when it starts and for the device that licenses its tracks.
|
||||
A remote session keeps the API key's entry it started with until it ends, also after a reload. A
|
||||
device name that names no device the server has, or any other sub-entry, stops the server at
|
||||
startup or refuses the reload.</p>
|
||||
<p><code>service_config</code> gives the API key its own service config. It maps a service tag to config keys,
|
||||
which the server merges over the service's <code>config.yaml</code> and the top-level <code>services</code> entry. A
|
||||
section of the service config that sets one of the same plain (not mapping or list) keys, such as
|
||||
a profile section with its own device identity, takes the API key's value too, so a client cannot
|
||||
select another identity through its profile name. The values stay on the server: no response sends
|
||||
them to a client. The cache that the service builds from them stays on the server only for a
|
||||
service that lists its identity cache keys, and the server logs a warning for a service that lists
|
||||
none. The server deletes that cache when a reload removes the API key.</p>
|
||||
<div class="language-yaml highlight"><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="nt">serve</span><span class="p">:</span>
|
||||
</span><span id="__span-3-2"><a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a><span class="w"> </span><span class="nt">users</span><span class="p">:</span>
|
||||
</span><span id="__span-3-3"><a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="w"> </span><span class="s">"key-1"</span><span class="p p-Indicator">:</span>
|
||||
</span><span id="__span-3-4"><a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a><span class="w"> </span><span class="nt">server_cdm</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE</span><span class="p p-Indicator">]</span>
|
||||
</span><span id="__span-3-5"><a id="__codelineno-3-5" name="__codelineno-3-5" href="#__codelineno-3-5"></a><span class="w"> </span><span class="nt">cdm</span><span class="p">:</span>
|
||||
</span><span id="__span-3-6"><a id="__codelineno-3-6" name="__codelineno-3-6" href="#__codelineno-3-6"></a><span class="w"> </span><span class="nt">EXAMPLE</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">example_device_1</span>
|
||||
</span><span id="__span-3-7"><a id="__codelineno-3-7" name="__codelineno-3-7" href="#__codelineno-3-7"></a><span class="w"> </span><span class="nt">service_config</span><span class="p">:</span>
|
||||
</span><span id="__span-3-8"><a id="__codelineno-3-8" name="__codelineno-3-8" href="#__codelineno-3-8"></a><span class="w"> </span><span class="nt">EXAMPLE</span><span class="p">:</span>
|
||||
</span><span id="__span-3-9"><a id="__codelineno-3-9" name="__codelineno-3-9" href="#__codelineno-3-9"></a><span class="w"> </span><span class="nt">device_id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">DEVICE-1</span>
|
||||
</span><span id="__span-3-10"><a id="__codelineno-3-10" name="__codelineno-3-10" href="#__codelineno-3-10"></a><span class="w"> </span><span class="nt">device_key</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">KEY-1</span>
|
||||
</span></code></pre></div>
|
||||
<p>An API key with its own <code>cdm</code> or <code>service_config</code> entry for a service cannot submit
|
||||
<code>/api/download</code> jobs for that service, because a job runs on the top-level config. On a server
|
||||
account, it shares the account's login with the other API keys but keeps its own device identity
|
||||
cache.</p>
|
||||
<p><code>admin</code> is a boolean that lets the API key run the maintenance endpoints (clear-cache, clear-temp, refresh-services). It is <code>false</code> unless the entry sets it. Keys that have no <code>users</code> entry, such as <code>api_secret</code>, keep that access.</p>
|
||||
<p><code>shared</code> is a boolean for an API key that a gateway in front of the server gives to many people.
|
||||
The gateway puts its own ID for each person in the <code>X-Client-Id</code> header, and the server then
|
||||
@@ -2433,19 +2470,19 @@ silently gets no limit. The rate limit never applies to the dashboard key, and n
|
||||
session for a listed service ignores the credentials, cookies, and cache the client sends and
|
||||
uses one of the server's own profiles from <code>credentials</code>. For a service that is not listed the
|
||||
server never uses its own accounts: a client that sends nothing authenticates with nothing.</p>
|
||||
<div class="language-yaml highlight"><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="nt">credentials</span><span class="p">:</span>
|
||||
</span><span id="__span-3-2"><a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a><span class="w"> </span><span class="nt">EXAMPLE1</span><span class="p">:</span>
|
||||
</span><span id="__span-3-3"><a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="w"> </span><span class="nt">ca_main</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">user1@example.com:pw1</span>
|
||||
</span><span id="__span-3-4"><a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a><span class="w"> </span><span class="nt">eu_box</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">user2@example.com:pw2</span>
|
||||
</span><span id="__span-3-5"><a id="__codelineno-3-5" name="__codelineno-3-5" href="#__codelineno-3-5"></a><span class="w"> </span><span class="nt">shared</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">user3@example.com:pw3</span>
|
||||
</span><span id="__span-3-6"><a id="__codelineno-3-6" name="__codelineno-3-6" href="#__codelineno-3-6"></a>
|
||||
</span><span id="__span-3-7"><a id="__codelineno-3-7" name="__codelineno-3-7" href="#__codelineno-3-7"></a><span class="nt">serve</span><span class="p">:</span>
|
||||
</span><span id="__span-3-8"><a id="__codelineno-3-8" name="__codelineno-3-8" href="#__codelineno-3-8"></a><span class="w"> </span><span class="nt">server_accounts</span><span class="p">:</span>
|
||||
</span><span id="__span-3-9"><a id="__codelineno-3-9" name="__codelineno-3-9" href="#__codelineno-3-9"></a><span class="w"> </span><span class="nt">EXAMPLE1</span><span class="p">:</span>
|
||||
</span><span id="__span-3-10"><a id="__codelineno-3-10" name="__codelineno-3-10" href="#__codelineno-3-10"></a><span class="w"> </span><span class="nt">ca_main</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">ca</span><span class="w"> </span><span class="c1"># one country</span>
|
||||
</span><span id="__span-3-11"><a id="__codelineno-3-11" name="__codelineno-3-11" href="#__codelineno-3-11"></a><span class="w"> </span><span class="nt">eu_box</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">gb</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">fr</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">de</span><span class="p p-Indicator">]</span><span class="w"> </span><span class="c1"># a list of countries</span>
|
||||
</span><span id="__span-3-12"><a id="__codelineno-3-12" name="__codelineno-3-12" href="#__codelineno-3-12"></a><span class="w"> </span><span class="nt">shared</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">global</span><span class="w"> </span><span class="c1"># any region</span>
|
||||
</span><span id="__span-3-13"><a id="__codelineno-3-13" name="__codelineno-3-13" href="#__codelineno-3-13"></a><span class="w"> </span><span class="nt">EXAMPLE2</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span><span class="w"> </span><span class="c1"># every profile (or the single credential), any region</span>
|
||||
<div class="language-yaml highlight"><pre><span></span><code><span id="__span-4-1"><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><span class="nt">credentials</span><span class="p">:</span>
|
||||
</span><span id="__span-4-2"><a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a><span class="w"> </span><span class="nt">EXAMPLE1</span><span class="p">:</span>
|
||||
</span><span id="__span-4-3"><a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a><span class="w"> </span><span class="nt">ca_main</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">user1@example.com:pw1</span>
|
||||
</span><span id="__span-4-4"><a id="__codelineno-4-4" name="__codelineno-4-4" href="#__codelineno-4-4"></a><span class="w"> </span><span class="nt">eu_box</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">user2@example.com:pw2</span>
|
||||
</span><span id="__span-4-5"><a id="__codelineno-4-5" name="__codelineno-4-5" href="#__codelineno-4-5"></a><span class="w"> </span><span class="nt">shared</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">user3@example.com:pw3</span>
|
||||
</span><span id="__span-4-6"><a id="__codelineno-4-6" name="__codelineno-4-6" href="#__codelineno-4-6"></a>
|
||||
</span><span id="__span-4-7"><a id="__codelineno-4-7" name="__codelineno-4-7" href="#__codelineno-4-7"></a><span class="nt">serve</span><span class="p">:</span>
|
||||
</span><span id="__span-4-8"><a id="__codelineno-4-8" name="__codelineno-4-8" href="#__codelineno-4-8"></a><span class="w"> </span><span class="nt">server_accounts</span><span class="p">:</span>
|
||||
</span><span id="__span-4-9"><a id="__codelineno-4-9" name="__codelineno-4-9" href="#__codelineno-4-9"></a><span class="w"> </span><span class="nt">EXAMPLE1</span><span class="p">:</span>
|
||||
</span><span id="__span-4-10"><a id="__codelineno-4-10" name="__codelineno-4-10" href="#__codelineno-4-10"></a><span class="w"> </span><span class="nt">ca_main</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">ca</span><span class="w"> </span><span class="c1"># one country</span>
|
||||
</span><span id="__span-4-11"><a id="__codelineno-4-11" name="__codelineno-4-11" href="#__codelineno-4-11"></a><span class="w"> </span><span class="nt">eu_box</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">gb</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">fr</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">de</span><span class="p p-Indicator">]</span><span class="w"> </span><span class="c1"># a list of countries</span>
|
||||
</span><span id="__span-4-12"><a id="__codelineno-4-12" name="__codelineno-4-12" href="#__codelineno-4-12"></a><span class="w"> </span><span class="nt">shared</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">global</span><span class="w"> </span><span class="c1"># any region</span>
|
||||
</span><span id="__span-4-13"><a id="__codelineno-4-13" name="__codelineno-4-13" href="#__codelineno-4-13"></a><span class="w"> </span><span class="nt">EXAMPLE2</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span><span class="w"> </span><span class="c1"># every profile (or the single credential), any region</span>
|
||||
</span></code></pre></div>
|
||||
<p>Each entry under a service names a profile from <code>credentials</code>, or a cookie file
|
||||
<code>cookies/<TAG>/<profile>.txt</code> for a service that has no credentials. Its value is the region or
|
||||
@@ -2485,33 +2522,33 @@ loopback, private, link-local and other special-purpose addresses, and <code>loc
|
||||
applies to a server on a LAN, so a client proxy on that LAN needs <code>server_proxy</code> or an admin key.
|
||||
The server checks the proxy values the job uses, including a <code>proxy</code> default from the server's
|
||||
own config.</p>
|
||||
<div class="language-yaml highlight"><pre><span></span><code><span id="__span-4-1"><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><span class="nt">serve</span><span class="p">:</span>
|
||||
</span><span id="__span-4-2"><a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a><span class="w"> </span><span class="nt">api_secret</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">change-me</span>
|
||||
</span><span id="__span-4-3"><a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a><span class="w"> </span><span class="nt">remote_only</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
|
||||
</span><span id="__span-4-4"><a id="__codelineno-4-4" name="__codelineno-4-4" href="#__codelineno-4-4"></a><span class="w"> </span><span class="nt">services</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">EXAMPLE2</span><span class="p p-Indicator">]</span>
|
||||
</span><span id="__span-4-5"><a id="__codelineno-4-5" name="__codelineno-4-5" href="#__codelineno-4-5"></a><span class="w"> </span><span class="nt">services_refresh_interval</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3600</span><span class="w"> </span><span class="c1"># pull the service repositories hourly and reload what changed</span>
|
||||
</span><span id="__span-4-6"><a id="__codelineno-4-6" name="__codelineno-4-6" href="#__codelineno-4-6"></a><span class="w"> </span><span class="c1"># server-wide download defaults (same keys as the `dl:` block)</span>
|
||||
</span><span id="__span-4-7"><a id="__codelineno-4-7" name="__codelineno-4-7" href="#__codelineno-4-7"></a><span class="w"> </span><span class="nt">downloads</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3</span>
|
||||
</span><span id="__span-4-8"><a id="__codelineno-4-8" name="__codelineno-4-8" href="#__codelineno-4-8"></a><span class="w"> </span><span class="nt">best_available</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
|
||||
</span><span id="__span-4-9"><a id="__codelineno-4-9" name="__codelineno-4-9" href="#__codelineno-4-9"></a><span class="w"> </span><span class="nt">tiers</span><span class="p">:</span>
|
||||
</span><span id="__span-4-10"><a id="__codelineno-4-10" name="__codelineno-4-10" href="#__codelineno-4-10"></a><span class="w"> </span><span class="nt">bot</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">{</span><span class="nt"> rate_limit</span><span class="p">:</span><span class="w"> </span><span class="nv">600</span><span class="w"> </span><span class="p p-Indicator">}</span><span class="w"> </span><span class="c1"># requests per hour, for every key on this tier</span>
|
||||
</span><span id="__span-4-11"><a id="__codelineno-4-11" name="__codelineno-4-11" href="#__codelineno-4-11"></a><span class="w"> </span><span class="nt">users</span><span class="p">:</span>
|
||||
</span><span id="__span-4-12"><a id="__codelineno-4-12" name="__codelineno-4-12" href="#__codelineno-4-12"></a><span class="w"> </span><span class="nt">a1b2c3d4</span><span class="p">:</span><span class="w"> </span><span class="c1"># this user's API key</span>
|
||||
</span><span id="__span-4-13"><a id="__codelineno-4-13" name="__codelineno-4-13" href="#__codelineno-4-13"></a><span class="w"> </span><span class="nt">services</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">]</span><span class="w"> </span><span class="c1"># may only use EXAMPLE1</span>
|
||||
</span><span id="__span-4-14"><a id="__codelineno-4-14" name="__codelineno-4-14" href="#__codelineno-4-14"></a><span class="w"> </span><span class="nt">tier</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">bot</span><span class="w"> </span><span class="c1"># 600 requests/hour; 429 with Retry-After once over</span>
|
||||
</span><span id="__span-4-15"><a id="__codelineno-4-15" name="__codelineno-4-15" href="#__codelineno-4-15"></a><span class="w"> </span><span class="nt">e5f6a7b8</span><span class="p">:</span>
|
||||
</span><span id="__span-4-16"><a id="__codelineno-4-16" name="__codelineno-4-16" href="#__codelineno-4-16"></a><span class="w"> </span><span class="nt">server_cdm</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span><span class="w"> </span><span class="c1"># this key may have the server do the licensing</span>
|
||||
</span><span id="__span-4-17"><a id="__codelineno-4-17" name="__codelineno-4-17" href="#__codelineno-4-17"></a><span class="w"> </span><span class="nt">server_cdm_max_height</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1080</span><span class="w"> </span><span class="c1"># above 1080p the client licenses with its own device</span>
|
||||
</span><span id="__span-4-18"><a id="__codelineno-4-18" name="__codelineno-4-18" href="#__codelineno-4-18"></a><span class="w"> </span><span class="nt">c9d0e1f2</span><span class="p">:</span>
|
||||
</span><span id="__span-4-19"><a id="__codelineno-4-19" name="__codelineno-4-19" href="#__codelineno-4-19"></a><span class="w"> </span><span class="nt">services</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">EXAMPLE2</span><span class="p p-Indicator">]</span>
|
||||
</span><span id="__span-4-20"><a id="__codelineno-4-20" name="__codelineno-4-20" href="#__codelineno-4-20"></a><span class="w"> </span><span class="nt">server_cdm</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">]</span><span class="w"> </span><span class="c1"># the server licenses only EXAMPLE1; EXAMPLE2 needs a local CDM</span>
|
||||
</span><span id="__span-4-21"><a id="__codelineno-4-21" name="__codelineno-4-21" href="#__codelineno-4-21"></a><span class="w"> </span><span class="nt">server_accounts</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">]</span><span class="w"> </span><span class="c1"># may authenticate EXAMPLE1 with one of the server's own accounts</span>
|
||||
</span><span id="__span-4-22"><a id="__codelineno-4-22" name="__codelineno-4-22" href="#__codelineno-4-22"></a><span class="w"> </span><span class="nt">server_proxy</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span><span class="w"> </span><span class="c1"># this key may also use the server's proxy providers</span>
|
||||
</span><span id="__span-4-23"><a id="__codelineno-4-23" name="__codelineno-4-23" href="#__codelineno-4-23"></a><span class="w"> </span><span class="nt">f3a4b5c6</span><span class="p">:</span>
|
||||
</span><span id="__span-4-24"><a id="__codelineno-4-24" name="__codelineno-4-24" href="#__codelineno-4-24"></a><span class="w"> </span><span class="nt">services</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">]</span>
|
||||
</span><span id="__span-4-25"><a id="__codelineno-4-25" name="__codelineno-4-25" href="#__codelineno-4-25"></a><span class="w"> </span><span class="nt">server_vault</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">]</span><span class="w"> </span><span class="c1"># the client's device licenses; the server vault still serves keys</span>
|
||||
</span><span id="__span-4-26"><a id="__codelineno-4-26" name="__codelineno-4-26" href="#__codelineno-4-26"></a><span class="w"> </span><span class="nt">d7e8f9a0</span><span class="p">:</span>
|
||||
</span><span id="__span-4-27"><a id="__codelineno-4-27" name="__codelineno-4-27" href="#__codelineno-4-27"></a><span class="w"> </span><span class="nt">shared</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span><span class="w"> </span><span class="c1"># a gateway gives this key to many people; tunnels count per X-Client-Id</span>
|
||||
<div class="language-yaml highlight"><pre><span></span><code><span id="__span-5-1"><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a><span class="nt">serve</span><span class="p">:</span>
|
||||
</span><span id="__span-5-2"><a id="__codelineno-5-2" name="__codelineno-5-2" href="#__codelineno-5-2"></a><span class="w"> </span><span class="nt">api_secret</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">change-me</span>
|
||||
</span><span id="__span-5-3"><a id="__codelineno-5-3" name="__codelineno-5-3" href="#__codelineno-5-3"></a><span class="w"> </span><span class="nt">remote_only</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
|
||||
</span><span id="__span-5-4"><a id="__codelineno-5-4" name="__codelineno-5-4" href="#__codelineno-5-4"></a><span class="w"> </span><span class="nt">services</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">EXAMPLE2</span><span class="p p-Indicator">]</span>
|
||||
</span><span id="__span-5-5"><a id="__codelineno-5-5" name="__codelineno-5-5" href="#__codelineno-5-5"></a><span class="w"> </span><span class="nt">services_refresh_interval</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3600</span><span class="w"> </span><span class="c1"># pull the service repositories hourly and reload what changed</span>
|
||||
</span><span id="__span-5-6"><a id="__codelineno-5-6" name="__codelineno-5-6" href="#__codelineno-5-6"></a><span class="w"> </span><span class="c1"># server-wide download defaults (same keys as the `dl:` block)</span>
|
||||
</span><span id="__span-5-7"><a id="__codelineno-5-7" name="__codelineno-5-7" href="#__codelineno-5-7"></a><span class="w"> </span><span class="nt">downloads</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3</span>
|
||||
</span><span id="__span-5-8"><a id="__codelineno-5-8" name="__codelineno-5-8" href="#__codelineno-5-8"></a><span class="w"> </span><span class="nt">best_available</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
|
||||
</span><span id="__span-5-9"><a id="__codelineno-5-9" name="__codelineno-5-9" href="#__codelineno-5-9"></a><span class="w"> </span><span class="nt">tiers</span><span class="p">:</span>
|
||||
</span><span id="__span-5-10"><a id="__codelineno-5-10" name="__codelineno-5-10" href="#__codelineno-5-10"></a><span class="w"> </span><span class="nt">bot</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">{</span><span class="nt"> rate_limit</span><span class="p">:</span><span class="w"> </span><span class="nv">600</span><span class="w"> </span><span class="p p-Indicator">}</span><span class="w"> </span><span class="c1"># requests per hour, for every key on this tier</span>
|
||||
</span><span id="__span-5-11"><a id="__codelineno-5-11" name="__codelineno-5-11" href="#__codelineno-5-11"></a><span class="w"> </span><span class="nt">users</span><span class="p">:</span>
|
||||
</span><span id="__span-5-12"><a id="__codelineno-5-12" name="__codelineno-5-12" href="#__codelineno-5-12"></a><span class="w"> </span><span class="nt">a1b2c3d4</span><span class="p">:</span><span class="w"> </span><span class="c1"># this user's API key</span>
|
||||
</span><span id="__span-5-13"><a id="__codelineno-5-13" name="__codelineno-5-13" href="#__codelineno-5-13"></a><span class="w"> </span><span class="nt">services</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">]</span><span class="w"> </span><span class="c1"># may only use EXAMPLE1</span>
|
||||
</span><span id="__span-5-14"><a id="__codelineno-5-14" name="__codelineno-5-14" href="#__codelineno-5-14"></a><span class="w"> </span><span class="nt">tier</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">bot</span><span class="w"> </span><span class="c1"># 600 requests/hour; 429 with Retry-After once over</span>
|
||||
</span><span id="__span-5-15"><a id="__codelineno-5-15" name="__codelineno-5-15" href="#__codelineno-5-15"></a><span class="w"> </span><span class="nt">e5f6a7b8</span><span class="p">:</span>
|
||||
</span><span id="__span-5-16"><a id="__codelineno-5-16" name="__codelineno-5-16" href="#__codelineno-5-16"></a><span class="w"> </span><span class="nt">server_cdm</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span><span class="w"> </span><span class="c1"># this key may have the server do the licensing</span>
|
||||
</span><span id="__span-5-17"><a id="__codelineno-5-17" name="__codelineno-5-17" href="#__codelineno-5-17"></a><span class="w"> </span><span class="nt">server_cdm_max_height</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1080</span><span class="w"> </span><span class="c1"># above 1080p the client licenses with its own device</span>
|
||||
</span><span id="__span-5-18"><a id="__codelineno-5-18" name="__codelineno-5-18" href="#__codelineno-5-18"></a><span class="w"> </span><span class="nt">c9d0e1f2</span><span class="p">:</span>
|
||||
</span><span id="__span-5-19"><a id="__codelineno-5-19" name="__codelineno-5-19" href="#__codelineno-5-19"></a><span class="w"> </span><span class="nt">services</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">EXAMPLE2</span><span class="p p-Indicator">]</span>
|
||||
</span><span id="__span-5-20"><a id="__codelineno-5-20" name="__codelineno-5-20" href="#__codelineno-5-20"></a><span class="w"> </span><span class="nt">server_cdm</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">]</span><span class="w"> </span><span class="c1"># the server licenses only EXAMPLE1; EXAMPLE2 needs a local CDM</span>
|
||||
</span><span id="__span-5-21"><a id="__codelineno-5-21" name="__codelineno-5-21" href="#__codelineno-5-21"></a><span class="w"> </span><span class="nt">server_accounts</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">]</span><span class="w"> </span><span class="c1"># may authenticate EXAMPLE1 with one of the server's own accounts</span>
|
||||
</span><span id="__span-5-22"><a id="__codelineno-5-22" name="__codelineno-5-22" href="#__codelineno-5-22"></a><span class="w"> </span><span class="nt">server_proxy</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span><span class="w"> </span><span class="c1"># this key may also use the server's proxy providers</span>
|
||||
</span><span id="__span-5-23"><a id="__codelineno-5-23" name="__codelineno-5-23" href="#__codelineno-5-23"></a><span class="w"> </span><span class="nt">f3a4b5c6</span><span class="p">:</span>
|
||||
</span><span id="__span-5-24"><a id="__codelineno-5-24" name="__codelineno-5-24" href="#__codelineno-5-24"></a><span class="w"> </span><span class="nt">services</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">]</span>
|
||||
</span><span id="__span-5-25"><a id="__codelineno-5-25" name="__codelineno-5-25" href="#__codelineno-5-25"></a><span class="w"> </span><span class="nt">server_vault</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="nv">EXAMPLE1</span><span class="p p-Indicator">]</span><span class="w"> </span><span class="c1"># the client's device licenses; the server vault still serves keys</span>
|
||||
</span><span id="__span-5-26"><a id="__codelineno-5-26" name="__codelineno-5-26" href="#__codelineno-5-26"></a><span class="w"> </span><span class="nt">d7e8f9a0</span><span class="p">:</span>
|
||||
</span><span id="__span-5-27"><a id="__codelineno-5-27" name="__codelineno-5-27" href="#__codelineno-5-27"></a><span class="w"> </span><span class="nt">shared</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span><span class="w"> </span><span class="c1"># a gateway gives this key to many people; tunnels count per X-Client-Id</span>
|
||||
</span></code></pre></div>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title"><code>dl</code> keys inside <code>serve</code></p>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<link rel="icon" href="../../../assets/favicon.svg">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.1">
|
||||
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.8.2">
|
||||
|
||||
|
||||
|
||||
@@ -2057,7 +2057,7 @@ name) and a <code>name</code>, plus backend-specific keys.</p>
|
||||
<td><code>MySQL</code></td>
|
||||
<td>Remote MySQL database</td>
|
||||
<td><code>name</code>, <code>host</code>, <code>database</code>, <code>username</code></td>
|
||||
<td>Extra keys (e.g. <code>password</code>, <code>port</code>) forwarded to pymysql. <code>connect_timeout</code> defaults to <code>vault_timeout</code>.</td>
|
||||
<td>Extra keys (e.g. <code>password</code>, <code>port</code>) forwarded to pymysql. <code>connect_timeout</code>, <code>read_timeout</code> and <code>write_timeout</code> default to <code>vault_timeout</code>. <code>autocommit</code> is always on.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>API</code></td>
|
||||
@@ -2113,7 +2113,7 @@ supplied the pair gets a report. A <code>serve</code> instance with
|
||||
</ul>
|
||||
<p>Timeout in seconds for vault operations. Injected automatically into any backend whose
|
||||
constructor accepts a <code>timeout</code> parameter (a per-vault <code>timeout</code> still wins). The <code>MySQL</code> backend
|
||||
uses it as the default <code>connect_timeout</code>.</p>
|
||||
uses it as the default <code>connect_timeout</code>, <code>read_timeout</code> and <code>write_timeout</code>.</p>
|
||||
<p>The <code>API</code> and <code>HTTP</code> backends send a request again up to 3 times when the vault answers
|
||||
<code>429 Too Many Requests</code>. They wait the <code>Retry-After</code> time, but never longer than this timeout.
|
||||
A connection failure or a timeout is not tried again. The run does not use a vault again after a
|
||||
|
||||
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-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/creating-a-service/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/service-architecture/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/authentication/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/dashboard/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/endpoints/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/errors/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/job-lifecycle/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/quickstart/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/remote-sessions/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/getting-started/configuration-file/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/getting-started/installation/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/getting-started/quickstart/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/cli-reference/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/downloading/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/drm-and-cdm/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/output-and-naming/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/proxies-and-vpn/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/subtitles/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/troubleshooting/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/vaults/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/config/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/drm/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/service/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/titles/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/tracks/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/directories/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/download/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/drm/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/example/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/misc/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/network/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/output/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/post-scripts/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/services/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/vaults/</loc>
|
||||
<lastmod>2026-11-11</lastmod>
|
||||
<lastmod>2026-11-27</lastmod>
|
||||
</url>
|
||||
</urlset>
|
||||
Binary file not shown.
Reference in New Issue
Block a user