Deployed f10b8dcf with MkDocs version: 1.6.1

This commit is contained in:
2026-12-05 03:15:49 +00:00
parent 6ed040a6dd
commit dfd9978019
16 changed files with 97 additions and 498 deletions
+2 -86
View File
@@ -2067,34 +2067,6 @@
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#error-responses" class="md-nav__link">
<span class="md-ellipsis">
Error responses
</span>
</a>
<nav class="md-nav" aria-label="Error responses">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#error-codes-and-default-status" class="md-nav__link">
<span class="md-ellipsis">
Error codes and default status
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
@@ -2826,34 +2798,6 @@
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#error-responses" class="md-nav__link">
<span class="md-ellipsis">
Error responses
</span>
</a>
<nav class="md-nav" aria-label="Error responses">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#error-codes-and-default-status" class="md-nav__link">
<span class="md-ellipsis">
Error codes and default status
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
@@ -2906,11 +2850,8 @@
<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="../remote-sessions/#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-services-relay">Remote services relay</a>.</li>
<li><strong>Errors.</strong> <a href="../errors/">Error Responses</a> gives the <a href="../errors/#the-standard-error-shape">standard error shape</a> and the <a href="../errors/#the-authentication-error-exception">authentication error</a> of the API-key middleware.</li>
</ul>
<div class="admonition warning">
<p class="admonition-title">Error responses have two shapes</p>
<p>Structured application errors (raised inside a handler) return <code>{"status": "error", "error_code": "...", "message": "...", "timestamp": "..."}</code>. The authentication middleware, however, returns a <strong>different</strong> shape: <code>{"status": 401, "message": "..."}</code> with an integer <code>status</code> and no <code>error_code</code>. The same middleware answers <code>429</code> in that shape when an API key goes over its rate limit. Clients must accept both shapes. The <a href="#error-responses">Error responses</a> section at the bottom of this page gives the full error model.</p>
</div>
<hr />
<h2 id="general-endpoints">General endpoints<a class="headerlink" href="#general-endpoints" title="Permanent link">&para;</a></h2>
<p>These endpoints report server state and enumerate what is available. <code>GET /api/health</code>, <code>GET /api/services</code>, and <code>POST /api/search</code> are also exposed in <code>--remote-only</code> mode.</p>
@@ -4171,7 +4112,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/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>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. 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. A name in <code>service_params</code>
@@ -5039,31 +4980,6 @@ key.</p>
</tbody>
</table>
<hr />
<h2 id="error-responses">Error responses<a class="headerlink" href="#error-responses" title="Permanent link">&para;</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-32-1"><a id="__codelineno-32-1" name="__codelineno-32-1" href="#__codelineno-32-1"></a><span class="p">{</span>
</span><span id="__span-32-2"><a id="__codelineno-32-2" name="__codelineno-32-2" href="#__codelineno-32-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-32-3"><a id="__codelineno-32-3" name="__codelineno-32-3" href="#__codelineno-32-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-32-4"><a id="__codelineno-32-4" name="__codelineno-32-4" href="#__codelineno-32-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-32-5"><a id="__codelineno-32-5" name="__codelineno-32-5" href="#__codelineno-32-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-32-6"><a id="__codelineno-32-6" name="__codelineno-32-6" href="#__codelineno-32-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-32-7"><a id="__codelineno-32-7" name="__codelineno-32-7" href="#__codelineno-32-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-32-8"><a id="__codelineno-32-8" name="__codelineno-32-8" href="#__codelineno-32-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-32-9"><a id="__codelineno-32-9" name="__codelineno-32-9" href="#__codelineno-32-9"></a><span class="p">}</span>
</span></code></pre></div>
<ul>
<li><code>details</code> appears only when non-empty.</li>
<li><code>retryable</code> appears only when the error is retryable (e.g. network errors, rate limiting).</li>
<li><code>debug_info</code> appears only when you start the server with <code>--debug-api</code>.</li>
</ul>
<div class="admonition warning">
<p class="admonition-title">Authentication errors differ</p>
<p>Errors raised by the API-key middleware use a distinct shape (<code>{"status": 401, "message": "Secret Key is Empty."}</code>, <code>{"status": 401, "message": "Secret Key is Invalid."}</code>, or <code>{"status": 429, "message": "Rate limit exceeded."}</code> with a <code>Retry-After</code> header) with an integer <code>status</code> and no <code>error_code</code>, <code>timestamp</code>, or <code>details</code>. A <code>429</code> from the middleware therefore carries no <code>error_code</code>, unlike the <code>RATE_LIMITED</code> code below, which a handler raises for a rate limit the <em>service</em> imposed. A malformed JSON body on any POST, by contrast, returns the standard envelope with <code>error_code: "INVALID_INPUT"</code>.</p>
</div>
<h3 id="error-codes-and-default-status">Error codes and default status<a class="headerlink" href="#error-codes-and-default-status" title="Permanent link">&para;</a></h3>
<p>The <a href="../errors/#error-code-catalogue">error code catalogue</a> gives the default HTTP status of each error code.</p>
<p>When a generic (uncategorised) exception reaches a handler, unshackle inspects its message and type to pick a code. For example, messages mentioning "connection" or "timeout" become <code>NETWORK_ERROR</code> (424, retryable), "rate limit" or "429" become <code>RATE_LIMITED</code> (429, retryable), and anything unrecognised collapses to <code>INTERNAL_ERROR</code> (422).</p>
<hr />
<h2 id="see-also">See also<a class="headerlink" href="#see-also" title="Permanent link">&para;</a></h2>
<ul>
<li><a href="../">Server Overview</a>. What the server is and when to use it.</li>
+2 -67
View File
@@ -2220,73 +2220,8 @@ start. See <a href="authentication/">Authentication</a> for how to set <code>api
how the <code>X-Secret-Key</code> header works.</p>
</div>
<h3 id="common-options">Common options<a class="headerlink" href="#common-options" title="Permanent link">&para;</a></h3>
<p>The <code>serve</code> command accepts the following flags:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Default</th>
<th>Effect</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>-h</code>, <code>--host</code></td>
<td><code>127.0.0.1</code></td>
<td>Address to bind to. Use <code>0.0.0.0</code> to accept connections from other machines.</td>
</tr>
<tr>
<td><code>-p</code>, <code>--port</code></td>
<td><code>8786</code></td>
<td>Port to bind to.</td>
</tr>
<tr>
<td><code>--api-only</code></td>
<td>off</td>
<td>Serve only the REST API, without the Widevine/PlayReady CDM HTTP endpoints.</td>
</tr>
<tr>
<td><code>--cdm-only</code></td>
<td>off</td>
<td>Serve only the Widevine/PlayReady CDM HTTP endpoints, plus <code>/api/health</code> and the dashboard. No REST API, no remote sessions, no Swagger UI. Cannot be combined with <code>--api-only</code> or <code>--remote-only</code>.</td>
</tr>
<tr>
<td><code>--no-widevine</code></td>
<td>off</td>
<td>Disable the Widevine CDM endpoints. Cannot be combined with <code>--api-only</code>.</td>
</tr>
<tr>
<td><code>--no-playready</code></td>
<td>off</td>
<td>Disable the PlayReady CDM endpoints. Cannot be combined with <code>--api-only</code>.</td>
</tr>
<tr>
<td><code>--no-key</code></td>
<td>off</td>
<td>Disable API-key authentication entirely; every request is allowed.</td>
</tr>
<tr>
<td><code>--remote-only</code></td>
<td>off</td>
<td>Expose only the <a href="remote-sessions/#routes">remote session routes</a>. Implies <code>--api-only</code>.</td>
</tr>
<tr>
<td><code>--debug-api</code></td>
<td>off</td>
<td>Include tracebacks and worker stderr in error responses.</td>
</tr>
<tr>
<td><code>--debug</code></td>
<td>off</td>
<td>Enable debug-level logging.</td>
</tr>
<tr>
<td><code>--caddy</code></td>
<td>off</td>
<td>Also launch <a href="https://caddyserver.com/">Caddy</a> as a reverse proxy, using the <code>Caddyfile</code> in your user-config directory.</td>
</tr>
</tbody>
</table>
<p>The <a href="../../guide/cli-reference/#serve"><code>serve</code> options</a> in the CLI reference give each flag, its
default and the flags that you cannot use together.</p>
<div class="language-shell highlight"><span class="filename">Serve the REST API only, on all interfaces</span><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>unshackle<span class="w"> </span>serve<span class="w"> </span>--api-only<span class="w"> </span>--host<span class="w"> </span><span class="m">0</span>.0.0.0<span class="w"> </span>--port<span class="w"> </span><span class="m">8786</span>
</span></code></pre></div>
<div class="admonition danger">
+6 -140
View File
@@ -2397,58 +2397,7 @@
<div class="language-shell highlight"><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>serve<span class="w"> </span>--api-only
</span></code></pre></div>
<p>By default the server binds to <code>127.0.0.1:8786</code>. The <code>--api-only</code> flag serves only the REST API and omits the Widevine/PlayReady CDM HTTP endpoints. Drop it when you also want those endpoints.</p>
<p>Common options:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Default</th>
<th>Effect</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>-h, --host</code></td>
<td><code>127.0.0.1</code></td>
<td>Address to bind to</td>
</tr>
<tr>
<td><code>-p, --port</code></td>
<td><code>8786</code></td>
<td>Port to bind to</td>
</tr>
<tr>
<td><code>--api-only</code></td>
<td>off</td>
<td>Serve only the REST API, no CDM endpoints</td>
</tr>
<tr>
<td><code>--no-key</code></td>
<td>off</td>
<td>Disable API-key authentication (allow all requests)</td>
</tr>
<tr>
<td><code>--debug-api</code></td>
<td>off</td>
<td>Include tracebacks and stderr in error responses</td>
</tr>
<tr>
<td><code>--debug</code></td>
<td>off</td>
<td>Enable DEBUG-level logging</td>
</tr>
<tr>
<td><code>--remote-only</code></td>
<td>off</td>
<td>Expose only the remote session routes: <code>/api/health</code>, <code>/api/services</code>, <code>/api/search</code>, <code>/api/session/*</code>, <code>/api/tunnel</code> and <code>/api/tunnel/check</code>, and the dashboard routes when <code>serve.dashboard.key</code> is set</td>
</tr>
<tr>
<td><code>--caddy</code></td>
<td>off</td>
<td>Also launch Caddy as a reverse proxy (for HTTPS)</td>
</tr>
</tbody>
</table>
<p>The <a href="../../../guide/cli-reference/#serve"><code>serve</code> options</a> in the CLI reference give every flag.</p>
<p>Once it is up you will see the API mounted under <code>/api/</code> and, unless you started in remote-only mode, an interactive Swagger UI:</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>REST API endpoints available at http://127.0.0.1:8786/api/
</span><span id="__span-5-2"><a id="__codelineno-5-2" name="__codelineno-5-2" href="#__codelineno-5-2"></a>Swagger UI available at http://127.0.0.1:8786/api/docs/
@@ -2508,7 +2457,7 @@
</span></code></pre></div>
<div class="admonition warning">
<p class="admonition-title">Two error shapes exist</p>
<p>The authentication middleware returns the short <code>{"status": 401, "message": "..."}</code> shape shown above. Every <strong>other</strong> error the API produces uses the richer structured shape (<code>error_code</code>, <code>timestamp</code>, <code>details</code>, ...) described in <a href="#error-handling">Error handling</a>. Parse both shapes in your client.</p>
<p>The authentication middleware answers with the short shape above, and every other JSON error has the <a href="../errors/#the-standard-error-shape">standard error shape</a>. Parse both shapes in your client.</p>
</div>
<p>The <code>tag</code> value for the service you want is the identifier you pass as <code>service</code> in the calls below.</p>
<hr />
@@ -2716,93 +2665,10 @@
<p>The interactive <strong>Swagger UI at <code>/api/docs/</code></strong> documents every route and lets you try them in the browser (send your <code>X-Secret-Key</code> there too).</p>
<hr />
<h2 id="error-handling">Error handling<a class="headerlink" href="#error-handling" title="Permanent link">&para;</a></h2>
<p>Apart from the auth middleware's short form, every error the API returns uses a single structured envelope:</p>
<div class="language-json 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="p">{</span>
</span><span id="__span-27-2"><a id="__codelineno-27-2" name="__codelineno-27-2" href="#__codelineno-27-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-27-3"><a id="__codelineno-27-3" name="__codelineno-27-3" href="#__codelineno-27-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-27-4"><a id="__codelineno-27-4" name="__codelineno-27-4" href="#__codelineno-27-4"></a><span class="w"> </span><span class="nt">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Human-readable description"</span><span class="p">,</span>
</span><span id="__span-27-5"><a id="__codelineno-27-5" name="__codelineno-27-5" href="#__codelineno-27-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:00Z"</span><span class="p">,</span>
</span><span id="__span-27-6"><a id="__codelineno-27-6" name="__codelineno-27-6" href="#__codelineno-27-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="p">}</span>
</span><span id="__span-27-7"><a id="__codelineno-27-7" name="__codelineno-27-7" href="#__codelineno-27-7"></a><span class="p">}</span>
</span></code></pre></div>
<p><code>details</code> appears only when the server has more to add. <code>retryable: true</code> appears only for transient failures. The server includes a <code>debug_info</code> block (exception type and traceback) only when it runs with <code>--debug-api</code>.</p>
<p>The <code>error_code</code> maps to an HTTP status. The ones you will meet most often:</p>
<table>
<thead>
<tr>
<th>Error code</th>
<th>HTTP</th>
<th>Typical cause</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>INVALID_INPUT</code></td>
<td>400</td>
<td>Malformed JSON body or missing required field</td>
</tr>
<tr>
<td><code>INVALID_SERVICE</code></td>
<td>400</td>
<td>Unknown or disallowed service tag</td>
</tr>
<tr>
<td><code>INVALID_PARAMETERS</code></td>
<td>400</td>
<td>A download field failed validation</td>
</tr>
<tr>
<td><code>AUTH_FAILED</code></td>
<td>401</td>
<td>Service login/credential failure</td>
</tr>
<tr>
<td><code>FORBIDDEN</code></td>
<td>403</td>
<td>A gated field was used without server opt-in</td>
</tr>
<tr>
<td><code>NOT_FOUND</code></td>
<td>404</td>
<td>Title or resource does not exist</td>
</tr>
<tr>
<td><code>JOB_NOT_FOUND</code></td>
<td>404</td>
<td>No job with that <code>job_id</code></td>
</tr>
<tr>
<td><code>CONFLICT</code></td>
<td>409</td>
<td>Illegal state transition (e.g. retry a running job)</td>
</tr>
<tr>
<td><code>SERVICE_ERROR</code></td>
<td>422</td>
<td>The service raised an error</td>
</tr>
<tr>
<td><code>RATE_LIMITED</code></td>
<td>429</td>
<td>Upstream throttling (retryable)</td>
</tr>
<tr>
<td><code>INTERNAL_ERROR</code></td>
<td>422</td>
<td>Unexpected server-side failure</td>
</tr>
<tr>
<td><code>NETWORK_ERROR</code></td>
<td>424</td>
<td>Connection/timeout reaching the service (retryable)</td>
</tr>
</tbody>
</table>
<p>The <a href="../errors/#error-code-catalogue">error code catalogue</a> lists every code.</p>
<div class="admonition tip">
<p class="admonition-title">Retry politely</p>
<p>Codes marked retryable (<code>NETWORK_ERROR</code>, <code>RATE_LIMITED</code>, <code>SERVICE_UNAVAILABLE</code>) reflect transient conditions. Back off and retry rather than hammering the server.</p>
</div>
<p>Every JSON error has one of two shapes: the <a href="../errors/#the-standard-error-shape">standard error shape</a>,
or the <a href="../errors/#the-authentication-error-exception">authentication error</a> of the API-key
middleware. The <a href="../errors/#error-code-catalogue">error code catalogue</a> gives the HTTP status of
each code, and <a href="../errors/#the-retryable-hint">the <code>retryable</code> hint</a> marks the errors to retry.</p>
+4 -4
View File
@@ -2720,9 +2720,9 @@
<h1 id="remote-session-protocol">Remote Session Protocol<a class="headerlink" href="#remote-session-protocol" title="Permanent link">&para;</a></h1>
<p>The remote session protocol is the one record of the routes, login states, error codes and message
shapes that a <code>--remote</code> client and the server share. A remote session keeps an authenticated
service on the server between requests. The client logs in one time, then asks for titles, tracks,
<p>This page lists the routes, login states, error codes and message shapes that a <code>--remote</code> client
and the server share. A remote session keeps an authenticated service on the server between
requests. The client logs in one time, then asks for titles, tracks,
segments and licences in the same remote session. The client downloads, decrypts and muxes.</p>
<p>The record is <code>unshackle/core/remote_protocol.py</code>: both the client (<code>unshackle/core/remote_service.py</code>,
the reference client) and the server (<code>unshackle/core/api/</code>) read it. Titles, tracks and DRM cross
@@ -3076,7 +3076,7 @@ limit, the server ends the remote session.</p>
</tr>
<tr>
<td>Remote sessions at the same time</td>
<td><code>serve.max_sessions</code>. A create at the limit ends the least recently used remote session of the API key that holds the most. A remote session that a request works on goes last.</td>
<td><code>serve.max_sessions</code>. A create at the limit ends one remote session: <a href="../../../reference/configuration/services/#serve"><code>max_sessions</code></a> gives which one.</td>
</tr>
<tr>
<td>Sweep</td>
+4 -4
View File
@@ -2852,10 +2852,10 @@ up the objects your methods rely on, such as <code>self.session</code>, <code>se
The attributes table of <a class="autorefs autorefs-internal" title="&lt;code class=&quot;doc-symbol doc-symbol-heading doc-symbol-class&quot;&gt;&lt;/code&gt; &lt;span class=&quot;doc doc-object-name doc-class-name&quot;&gt;Service&lt;/span&gt;" href="../../reference/api/service/#unshackle.core.service.Service"><code>Service</code></a> lists each one.
<a href="#request-and-http-session-objects">Request and HTTP session objects</a> explains the main ones.</p>
<p>The constructor also resolves proxies: it reads <code>--proxy</code>, which <code>dl</code> and <code>search</code> have already
resolved through 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"
error, because there is no main region to fetch a proxy for; pass <code>--proxy</code> yourself.
resolved through the per-service <code>proxy_map</code>. Without an explicit proxy, it does a live IP check
and, when it detects a geoblock, fetches a proxy to the first <code>GEOFENCE</code> region that <code>GEOBLOCK</code>
allows, as the attributes of <a class="autorefs autorefs-internal" title="&lt;code class=&quot;doc-symbol doc-symbol-heading doc-symbol-class&quot;&gt;&lt;/code&gt; &lt;span class=&quot;doc doc-object-name doc-class-name&quot;&gt;Service&lt;/span&gt;" href="../../reference/api/service/#unshackle.core.service.Service"><code>Service</code></a> give. When no such region
is left, the run stops with a "not available in your region" error; pass <code>--proxy</code> yourself.
A proxy whose exit is in a <code>GEOBLOCK</code> region stops the run the same way. A proxy whose exit is
outside <code>GEOFENCE</code> logs a warning and the run continues.
See <a href="../../guide/proxies-and-vpn/">Proxies and VPN</a>.</p>
+8 -42
View File
@@ -2443,48 +2443,14 @@ and note the <code>id</code> it prints, because that is what you feed to <code>d
the content keys through your CDM (and any key vaults). It then decrypts, muxes, and
tags the result.</p>
<h3 id="handy-first-flags">Handy first flags<a class="headerlink" href="#handy-first-flags" title="Permanent link">&para;</a></h3>
<table>
<thead>
<tr>
<th>Flag</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>-q</code>, <code>--quality</code></td>
<td>Target resolution(s), e.g. <code>-q 1080</code> or <code>-q 1080,720</code>. Defaults to best available.</td>
</tr>
<tr>
<td><code>-l</code>, <code>--lang</code></td>
<td>Language(s) for video and audio, e.g. <code>-l en</code> or <code>-l orig,en</code>. <code>orig</code> = the title's original language. Defaults to <code>orig</code>.</td>
</tr>
<tr>
<td><code>-sl</code>, <code>--s-lang</code></td>
<td>Subtitle language(s); defaults to <code>all</code>.</td>
</tr>
<tr>
<td><code>-v</code>, <code>--vcodec</code></td>
<td>Video codec, e.g. <code>-v H.265</code>. Defaults to any.</td>
</tr>
<tr>
<td><code>-r</code>, <code>--range</code></td>
<td>Dynamic range, e.g. <code>-r HDR10</code> or <code>-r DV</code>. Defaults to <code>SDR</code>.</td>
</tr>
<tr>
<td><code>-w</code>, <code>--wanted</code></td>
<td>Which episodes, e.g. <code>-w S01</code> or <code>-w S01E01-S01E03</code>. For music, which tracks, e.g. <code>-w 1-5</code> or <code>-w 2x3</code> for disc 2 track 3.</td>
</tr>
<tr>
<td><code>-o</code>, <code>--output</code></td>
<td>Override the output directory for this run.</td>
</tr>
<tr>
<td><code>--list</code></td>
<td>List every track of each title, then stop before track selection.</td>
</tr>
</tbody>
</table>
<p>These flags shape a first download. The CLI reference gives what each one does:</p>
<ul>
<li><a href="../../guide/cli-reference/#quality-codec-bitrate-range"><code>-q</code>/<code>--quality</code>, <code>-v</code>/<code>--vcodec</code>, <code>-r</code>/<code>--range</code></a></li>
<li><a href="../../guide/cli-reference/#language-subtitles"><code>-l</code>/<code>--lang</code>, <code>-sl</code>/<code>--s-lang</code></a></li>
<li><a href="../../guide/cli-reference/#title-episode-selection"><code>-w</code>/<code>--wanted</code></a></li>
<li><a href="../../guide/cli-reference/#output-muxing-files"><code>-o</code>/<code>--output</code></a></li>
<li><a href="../../guide/cli-reference/#concurrency-caching-listing"><code>--list</code></a></li>
</ul>
<div class="admonition example">
<p class="admonition-title">A few realistic variations</p>
<div class="language-shell 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="c1"># A whole first season in the best available quality</span>
+49 -33
View File
@@ -3457,42 +3457,48 @@ configuration file.</p>
<table>
<thead>
<tr>
<th>Include-only</th>
<th>Skip</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>-V</code>, <code>--video-only</code></td>
<td><code>-nv</code>, <code>--no-video</code></td>
</tr>
<tr>
<td><code>-A</code>, <code>--audio-only</code></td>
<td><code>-na</code>, <code>--no-audio</code></td>
</tr>
<tr>
<td><code>-S</code>, <code>--subs-only</code></td>
<td><code>-ns</code>, <code>--no-subs</code></td>
</tr>
<tr>
<td><code>-C</code>, <code>--chapters-only</code></td>
<td><code>-nc</code>, <code>--no-chapters</code></td>
</tr>
<tr>
<td></td>
<td><code>-nt</code>, <code>--no-attachments</code> (cover art, subtitle fonts, and files the service attaches)</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Flag</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>-V</code>, <code>--video-only</code></td>
<td>Keep only the video tracks.</td>
</tr>
<tr>
<td><code>-A</code>, <code>--audio-only</code></td>
<td>Keep only the audio tracks.</td>
</tr>
<tr>
<td><code>-S</code>, <code>--subs-only</code></td>
<td>Keep only the subtitle tracks.</td>
</tr>
<tr>
<td><code>-C</code>, <code>--chapters-only</code></td>
<td>Keep only the chapters.</td>
</tr>
<tr>
<td><code>-nv</code>, <code>--no-video</code></td>
<td>Skip the video tracks.</td>
</tr>
<tr>
<td><code>-na</code>, <code>--no-audio</code></td>
<td>Skip the audio tracks.</td>
</tr>
<tr>
<td><code>-ns</code>, <code>--no-subs</code></td>
<td>Skip the subtitle tracks.</td>
</tr>
<tr>
<td><code>-nc</code>, <code>--no-chapters</code></td>
<td>Skip the chapters.</td>
</tr>
<tr>
<td><code>-nt</code>, <code>--no-attachments</code></td>
<td>Skip the attachments: cover art, subtitle fonts, and files the service attaches.</td>
</tr>
<tr>
<td><code>-ad</code>, <code>--audio-description</code></td>
<td>Include descriptive (audio-description) tracks. Without it, unshackle drops them.</td>
</tr>
@@ -4209,7 +4215,7 @@ through the tunnel. It stops at the first step that fails.</p>
<tr>
<td><code>-h</code>, <code>--host</code></td>
<td><code>127.0.0.1</code></td>
<td>Host to serve from.</td>
<td>Host to serve from. <code>0.0.0.0</code> accepts connections from other machines.</td>
</tr>
<tr>
<td><code>-p</code>, <code>--port</code></td>
@@ -4219,7 +4225,7 @@ through the tunnel. It stops at the first step that fails.</p>
<tr>
<td><code>--caddy</code></td>
<td>off</td>
<td>Also serve through Caddy (requires the <code>caddy</code> binary and a <code>Caddyfile</code>).</td>
<td>Also serve through Caddy as a reverse proxy, with the <code>Caddyfile</code> in your user config directory. Needs the <code>caddy</code> binary.</td>
</tr>
<tr>
<td><code>--api-only</code></td>
@@ -4227,6 +4233,11 @@ through the tunnel. It stops at the first step that fails.</p>
<td>Serve only the REST API, not the CDM endpoints. Incompatible with <code>--no-widevine</code>/<code>--no-playready</code>.</td>
</tr>
<tr>
<td><code>--cdm-only</code></td>
<td>off</td>
<td>Serve only the Widevine/PlayReady CDM endpoints, plus <code>/api/health</code> and the dashboard: no REST API, no remote sessions and no Swagger UI. Incompatible with <code>--api-only</code> and <code>--remote-only</code>.</td>
</tr>
<tr>
<td><code>--no-widevine</code></td>
<td>off</td>
<td>Disable the Widevine CDM endpoints.</td>
@@ -4254,7 +4265,12 @@ through the tunnel. It stops at the first step that fails.</p>
<tr>
<td><code>--remote-only</code></td>
<td>off</td>
<td>Expose only the remote session routes: <code>/api/health</code>, <code>/api/services</code>, <code>/api/search</code>, <code>/api/session/*</code>, <code>/api/tunnel</code> and <code>/api/tunnel/check</code>, and the dashboard routes when <code>serve.dashboard.key</code> is set. Implies <code>--api-only</code>.</td>
<td>Expose only the <a href="../../dev/rest-api/remote-sessions/#routes">remote session routes</a> and the dashboard routes when <code>serve.dashboard.key</code> is set. Implies <code>--api-only</code>.</td>
</tr>
<tr>
<td><code>-q</code>, <code>--quiet</code></td>
<td>off</td>
<td>Headless mode: no banner and no Rich output, plain log lines on stderr. With <code>--debug</code>, also writes the log to a file in <code>directories.logs</code>.</td>
</tr>
</tbody>
</table>
+2 -23
View File
@@ -2627,29 +2627,8 @@
</span></code></pre></div>
The folder name comes from the <code>series</code> folder template and the file from the <code>series</code> output template.</p>
</div>
<p>Two command-line flags change this layout for a single run:</p>
<table>
<thead>
<tr>
<th>Flag</th>
<th>Effect</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>-o</code>, <code>--output</code></td>
<td>Use this directory instead of <code>directories.downloads</code>.</td>
</tr>
<tr>
<td><code>--no-folder</code></td>
<td>Skip the per-title subfolder; write the file directly into the output directory.</td>
</tr>
<tr>
<td><code>--no-source</code></td>
<td>Omit the service source tag from both the filename and folder (the <code>{source}</code> variable resolves to empty).</td>
</tr>
</tbody>
</table>
<p>The <a href="../cli-reference/#output-muxing-files"><code>-o</code>/<code>--output</code>, <code>--no-folder</code> and <code>--no-source</code> flags</a>
change this layout for a single run.</p>
<h2 id="output-templates">Output templates<a class="headerlink" href="#output-templates" title="Permanent link">&para;</a></h2>
<p>Filename templates live under the <code>output_template</code> config key, keyed by title kind. Each value is a format string built from <code>{variable}</code> placeholders.</p>
<div class="language-yaml highlight"><span class="filename">unshackle.yaml</span><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">output_template</span><span class="p">:</span>
+7 -36
View File
@@ -2824,37 +2824,11 @@ config key in your <code>unshackle.yaml</code>. Each proxy provider has its own
proxy provider, with their types and defaults.</p>
</div>
<h2 id="the-proxy-flag">The <code>--proxy</code> flag<a class="headerlink" href="#the-proxy-flag" title="Permanent link">&para;</a></h2>
<p>Five options on the <code>dl</code> command control proxying at download time:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Effect</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--proxy</code></td>
<td>The proxy to use. Either an explicit URI, or a query that unshackle resolves against your configured providers.</td>
</tr>
<tr>
<td><code>--local-proxy</code></td>
<td>With <code>--remote</code>, send the server's service requests through your machine's own connection, or through a <code>--proxy</code> that your machine connects to. See <a href="#send-the-servers-requests-through-your-machine">Send the server's requests through your machine</a>.</td>
</tr>
<tr>
<td><code>--no-proxy</code></td>
<td>Force <strong>all</strong> proxy use off. No providers are initialised and no proxy query is resolved.</td>
</tr>
<tr>
<td><code>--no-proxy-download</code></td>
<td>Use the proxy for the manifest, licence, and authentication, but bypass it for the <strong>downloads</strong> themselves.</td>
</tr>
<tr>
<td><code>--proxy-download</code></td>
<td>Use <code>--proxy</code> for the manifest, licence, and authentication, and a different proxy for the <strong>downloads</strong>. Takes the same forms as <code>--proxy</code>.</td>
</tr>
</tbody>
</table>
<p>Five options on the <code>dl</code> command control proxying at download time: <code>--proxy</code>, <code>--local-proxy</code>,
<code>--no-proxy</code>, <code>--no-proxy-download</code> and <code>--proxy-download</code>. The
<a href="../cli-reference/#network-proxy">network and proxy flags</a> give what each one does.
<a href="#send-the-servers-requests-through-your-machine">Send the server's requests through your machine</a>
explains <code>--local-proxy</code>.</p>
<div class="language-shell highlight"><span class="filename">Explicit proxy URI</span><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>unshackle<span class="w"> </span>dl<span class="w"> </span>--proxy<span class="w"> </span>http://user:pass@1.2.3.4:8080<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">Resolve a US server from your configured providers</span><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-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>
@@ -3333,11 +3307,8 @@ server only that endpoint's resolver ID, as <code>controld://&lt;resolver&gt;@dn
The server runs its own forwarder with it, from its own address, and needs no Control D
configuration. The resolver ID lets anyone who has it use that endpoint's proxy, so treat
it as a secret: unshackle masks it in logs and in stored job parameters.</p>
<p>The server must run a version of unshackle that knows <code>controld://</code>. An older server
rejects it with <code>INVALID_PROXY</code>: <code>Proxy provider 'controld' not found</code> when your API key
has <code>server_proxy</code>, else a message that asks for a full proxy URI. A bare region, such
as <code>--proxy ca</code>, skips Control D with <code>--remote</code>, because the proxy it gives is on your
machine. A service whose accounts the server manages does not accept a proxy from the
<p>A bare region, such as <code>--proxy ca</code>, skips Control D with <code>--remote</code>, because the proxy it
gives is on your machine. A service whose accounts the server manages does not accept a proxy from the
client, and that includes a Control D resolver.</p>
</div>
<h3 id="troubleshooting-control-d">Troubleshooting Control D<a class="headerlink" href="#troubleshooting-control-d" title="Permanent link">&para;</a></h3>
+4 -55
View File
@@ -2682,61 +2682,10 @@ format-appropriate clean-up to make a single, valid file:</p>
</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">&para;</a></h2>
<p>Subtitle selection happens through <code>dl</code> flags. The most important is language selection.</p>
<table>
<thead>
<tr>
<th>Flag</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>-sl</code>, <code>--s-lang</code></td>
<td>Language(s) wanted for subtitles. Defaults to <code>all</code>. A <code>-</code> prefix excludes, e.g. <code>all,-es</code>.</td>
</tr>
<tr>
<td><code>--require-subs</code></td>
<td>Require these languages to exist. The title fails if one is missing. <code>--s-lang</code> still decides what to keep.</td>
</tr>
<tr>
<td><code>-fs</code>, <code>--forced-subs</code></td>
<td>Include forced subtitle tracks (excluded by default).</td>
</tr>
<tr>
<td><code>-fso</code>, <code>--forced-subs-only</code></td>
<td>Keep only forced subtitle tracks and drop the other subtitles; implies <code>-fs</code>.</td>
</tr>
<tr>
<td><code>-fsl</code>, <code>--forced-s-lang</code></td>
<td>Language(s) wanted for forced subtitles; implies <code>-fs</code>. A <code>-</code> prefix excludes.</td>
</tr>
<tr>
<td><code>--exact-lang</code></td>
<td>A tag without a region never falls back to another variant: <code>es</code> does not match <code>es-419</code>.</td>
</tr>
<tr>
<td><code>-S</code>, <code>--subs-only</code></td>
<td>Download only subtitle tracks.</td>
</tr>
<tr>
<td><code>-ns</code>, <code>--no-subs</code></td>
<td>Do not download subtitle tracks at all.</td>
</tr>
<tr>
<td><code>--sub-format</code></td>
<td>Output subtitle format / conversion target (see <a href="#converting-subtitle-formats">conversion</a>).</td>
</tr>
<tr>
<td><code>--sub-font</code></td>
<td>Font for subtitles converted to ASS; implies <code>--sub-format ass</code> (see <a href="#custom-font-and-style">custom font and style</a>).</td>
</tr>
<tr>
<td><code>--skip-subtitle-errors</code></td>
<td>Skip a subtitle that fails to download instead of aborting the whole title.</td>
</tr>
</tbody>
</table>
<p>Subtitle selection happens through <code>dl</code> flags. The most important is language selection.
The <a href="../cli-reference/#language-subtitles">language and subtitle flags</a> give the meaning and
default of each one. <code>--subs-only</code>, <code>--no-subs</code> and <code>--skip-subtitle-errors</code> are with the
<a href="../cli-reference/#track-type-inclusion-exclusion">track-type flags</a>.</p>
<h3 id="choosing-languages">Choosing languages<a class="headerlink" href="#choosing-languages" title="Permanent link">&para;</a></h3>
<p>By default (<code>--s-lang all</code>) unshackle keeps every subtitle language the service offers.
To narrow it down, pass a comma-separated list of language tags:</p>
+2 -2
View File
@@ -2071,7 +2071,7 @@ default.</p>
<td><code>dl</code>, <code>continue_downloads</code>, <code>merge_segments</code>, <code>subtitle</code>, <code>audio</code>, <code>muxing</code>, <code>language_tags</code>, <code>dual_multi_mode</code>, <code>generate_dv_mode</code>, <code>hdr10plus_probe</code></td>
</tr>
<tr>
<td><a href="output/">Output &amp; naming</a></td>
<td><a href="output/">Output &amp; naming options</a></td>
<td><code>output_template</code>, <code>tag</code>, <code>tag_rules</code>, <code>codec_names</code>, <code>tag_group_name</code>, <code>tag_imdb_tmdb</code>, <code>chapter_fallback_name</code>, <code>unicode_filenames</code>, <code>filename_replacements</code></td>
</tr>
<tr>
@@ -2083,7 +2083,7 @@ default.</p>
<td><code>network</code>, <code>headers</code>, <code>proxy_providers</code></td>
</tr>
<tr>
<td><a href="vaults/">Key vaults</a></td>
<td><a href="vaults/">Key vault options</a></td>
<td><code>key_vaults</code>, <code>vault_timeout</code></td>
</tr>
<tr>
@@ -2336,6 +2336,8 @@
<h1 id="network-proxy">Network &amp; Proxy<a class="headerlink" href="#network-proxy" title="Permanent link">&para;</a></h1>
<p>Keys that control the HTTP client, the headers that it sends and the proxy providers. For how
<code>--proxy</code> picks a proxy, see the <a href="../../../guide/proxies-and-vpn/">Proxies &amp; VPN guide</a>.</p>
<h2 id="network"><code>network</code><a class="headerlink" href="#network" title="Permanent link">&para;</a></h2>
<ul>
<li><strong>Type:</strong> <code>dict</code> &nbsp;·&nbsp; <strong>Default:</strong> <code>{}</code></li>
+1 -1
View File
@@ -2237,7 +2237,7 @@
<h1 id="output-naming">Output &amp; Naming<a class="headerlink" href="#output-naming" title="Permanent link">&para;</a></h1>
<h1 id="output-naming">Output &amp; Naming Options<a class="headerlink" href="#output-naming" title="Permanent link">&para;</a></h1>
<p>Keys that control the output filename, the per-title subfolder, release-group tagging, and
filename character handling. For how unshackle builds a path, and for worked naming examples, see
the <a href="../../../guide/output-and-naming/">Output &amp; naming guide</a>.</p>
+2 -3
View File
@@ -2316,8 +2316,7 @@ does not answer, <code>dl --remote</code> keeps a service command with no servic
works.</p>
<p><code>timeout</code> is the time in seconds that the client waits for data from the server. The
default is <code>120</code>. The server sends a heartbeat every 30 seconds while it gets titles, tracks
or licences, so a slow service does not cause a timeout. Increase <code>timeout</code> only when the
server runs an older version that sends no heartbeat. Give a number of seconds. With a
or licences, so a slow service does not cause a timeout. Give a number of seconds. With a
value below 30 the client can time out before the first heartbeat. <code>0</code> means the default.</p>
<p>In <code>--remote</code> mode unshackle turns the server's service list into synthetic CLI
commands that operate against it, falling back to the tags in that <code>services</code> sub-dict when
@@ -2389,7 +2388,7 @@ is the <a href="../../../dev/rest-api/">Server</a> section of the user guide. Th
<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 least recently used remote session of the API key that holds the most, and a remote session that a request works on goes last. 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, a new remote session ends one: the server picks first among the remote sessions that no request works on, then among those of the API key that holds the most, and takes the least recently used. 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>
+1 -1
View File
@@ -2225,7 +2225,7 @@
<h1 id="key-vaults">Key Vaults<a class="headerlink" href="#key-vaults" title="Permanent link">&para;</a></h1>
<h1 id="key-vaults">Key Vault Options<a class="headerlink" href="#key-vaults" title="Permanent link">&para;</a></h1>
<p>Two config keys configure the key vaults. What a vault does during a download, the decode
check and the <code>kv</code> commands are in the <a href="../../../guide/vaults/">Vaults</a> guide.</p>
<h2 id="key_vaults"><code>key_vaults</code><a class="headerlink" href="#key_vaults" title="Permanent link">&para;</a></h2>
File diff suppressed because one or more lines are too long