mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-25 10:25:09 +00:00
Deployed e30db081 with MkDocs version: 1.6.1
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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">
|
||||
@@ -2875,6 +2886,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">
|
||||
@@ -4896,15 +4918,16 @@ 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
|
||||
</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/bad → report a server-vault content key that did not decrypt
|
||||
</span><span id="__span-30-11"><a id="__codelineno-30-11" name="__codelineno-30-11" href="#__codelineno-30-11"></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
|
||||
@@ -4965,8 +4988,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">
|
||||
@@ -5050,7 +5101,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">
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -2499,6 +2499,11 @@ request and response in full.</p>
|
||||
</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>
|
||||
|
||||
@@ -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
|
||||
@@ -2755,8 +2776,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 +2824,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>
|
||||
@@ -2942,18 +2964,23 @@ from a browser origin, not when you want only the local HTTP API.</p>
|
||||
</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>
|
||||
@@ -3005,8 +3032,9 @@ 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
|
||||
@@ -3015,16 +3043,16 @@ layer.</p>
|
||||
<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
|
||||
<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>
|
||||
@@ -3043,6 +3071,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></td>
|
||||
<td>The service asks the user for input</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></td>
|
||||
<td>One record of the service log, with the same redaction as <code>GET /logs</code></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>
|
||||
@@ -3050,12 +3146,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
|
||||
@@ -3106,7 +3201,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>
|
||||
@@ -3138,7 +3233,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 client gives a warning when it has more than 256 cache files to send. 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>
|
||||
@@ -3152,8 +3247,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
|
||||
@@ -3161,7 +3257,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,
|
||||
@@ -3178,8 +3276,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
|
||||
|
||||
@@ -2818,7 +2818,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"
|
||||
|
||||
BIN
Binary file not shown.
@@ -2753,17 +2753,6 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#unshackle.core.drm.drm_from_dict" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
<code class="doc-symbol doc-symbol-toc doc-symbol-function"></code> drm_from_dict
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -3674,17 +3663,6 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#unshackle.core.drm.drm_from_dict" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
<code class="doc-symbol doc-symbol-toc doc-symbol-function"></code> drm_from_dict
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -4166,7 +4144,7 @@ here as a JWK Set keyed by KID, and the media is standard CENC
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
<p class="doc doc-class-bases">
|
||||
Bases: <code><span title="Exception">Exception</span></code></p>
|
||||
Bases: <code><span title="click.ClickException">ClickException</span></code></p>
|
||||
|
||||
|
||||
|
||||
@@ -4197,7 +4175,7 @@ here as a JWK Set keyed by KID, and the media is standard CENC
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
<p class="doc doc-class-bases">
|
||||
Bases: <code><span title="Exception">Exception</span></code></p>
|
||||
Bases: <code><span title="click.ClickException">ClickException</span></code></p>
|
||||
|
||||
|
||||
|
||||
@@ -4238,9 +4216,7 @@ here as a JWK Set keyed by KID, and the media is standard CENC
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Serialise this DRM instance for export/import (KIDs + license URL).</p>
|
||||
<p>unshackle stores the content keys once at the export's track level, and does not
|
||||
duplicate them here.</p>
|
||||
<p>This DRM in the export form; see <code>wire.drm_to_dict</code>.</p>
|
||||
|
||||
|
||||
</div>
|
||||
@@ -5242,9 +5218,7 @@ the REST API can parse it again.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Serialise this DRM instance for export/import (PSSH + KIDs).</p>
|
||||
<p>unshackle stores the content keys once at the export's track level, and does not
|
||||
duplicate them here.</p>
|
||||
<p>This DRM in the export form; see <code>wire.drm_to_dict</code>.</p>
|
||||
|
||||
|
||||
</div>
|
||||
@@ -5821,7 +5795,7 @@ track exactly. A PSSH can name the KIDs of other renditions too.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
<p class="doc doc-class-bases">
|
||||
Bases: <code><span title="Exception">Exception</span></code></p>
|
||||
Bases: <code><span title="click.ClickException">ClickException</span></code></p>
|
||||
|
||||
|
||||
|
||||
@@ -5852,7 +5826,7 @@ track exactly. A PSSH can name the KIDs of other renditions too.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
<p class="doc doc-class-bases">
|
||||
Bases: <code><span title="Exception">Exception</span></code></p>
|
||||
Bases: <code><span title="click.ClickException">ClickException</span></code></p>
|
||||
|
||||
|
||||
|
||||
@@ -6041,9 +6015,7 @@ It is <em>rare</em> to need to use this.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Serialise this DRM instance for export/import (PSSH + KIDs).</p>
|
||||
<p>unshackle stores the content keys once at the export's track level, and does not
|
||||
duplicate them here.</p>
|
||||
<p>This DRM in the export form; see <code>wire.drm_to_dict</code>.</p>
|
||||
|
||||
|
||||
</div>
|
||||
@@ -6206,29 +6178,6 @@ track exactly. A PSSH can name the KIDs of other renditions too.</p>
|
||||
<div class="doc doc-object doc-function">
|
||||
|
||||
|
||||
<h2 id="unshackle.core.drm.drm_from_dict" class="doc doc-heading">
|
||||
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">drm_from_dict</span>
|
||||
|
||||
|
||||
<a href="#unshackle.core.drm.drm_from_dict" class="headerlink" title="Permanent link">¶</a></h2>
|
||||
<div class="language-python doc-signature highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">drm_from_dict</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Reconstruct a Widevine/PlayReady/ClearKeyCENC DRM instance from its <code>to_dict()</code> form.</p>
|
||||
<p>Rebuilds the PSSH from the stored base64 (KIDs for ClearKey, which has no PSSH)
|
||||
and re-injects any saved content keys so the resulting object can decrypt without
|
||||
contacting a license server.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="doc doc-object doc-function">
|
||||
|
||||
|
||||
<h2 id="unshackle.core.drm.drop_null_keys" class="doc doc-heading">
|
||||
<code class="doc-symbol doc-symbol-heading doc-symbol-function"></code> <span class="doc doc-object-name doc-function-name">drop_null_keys</span>
|
||||
|
||||
|
||||
+688
-696
File diff suppressed because it is too large
Load Diff
@@ -2859,6 +2859,28 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#unshackle.core.tracks.Track.pssh_order" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
<code class="doc-symbol doc-symbol-toc doc-symbol-method"></code> pssh_order
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#unshackle.core.tracks.Track.drm_from_pssh" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
<code class="doc-symbol doc-symbol-toc doc-symbol-method"></code> drm_from_pssh
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -2892,28 +2914,6 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#unshackle.core.tracks.Track.base_kwargs_from_dict" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
<code class="doc-symbol doc-symbol-toc doc-symbol-method"></code> base_kwargs_from_dict
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#unshackle.core.tracks.Track.from_dict" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
<code class="doc-symbol doc-symbol-toc doc-symbol-method"></code> from_dict
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -4536,6 +4536,28 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#unshackle.core.tracks.Track.pssh_order" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
<code class="doc-symbol doc-symbol-toc doc-symbol-method"></code> pssh_order
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#unshackle.core.tracks.Track.drm_from_pssh" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
<code class="doc-symbol doc-symbol-toc doc-symbol-method"></code> drm_from_pssh
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -4569,28 +4591,6 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#unshackle.core.tracks.Track.base_kwargs_from_dict" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
<code class="doc-symbol doc-symbol-toc doc-symbol-method"></code> base_kwargs_from_dict
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#unshackle.core.tracks.Track.from_dict" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
<code class="doc-symbol doc-symbol-toc doc-symbol-method"></code> from_dict
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -5398,7 +5398,7 @@ If mime_type is not provided, it will try to guess it.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Serialise a URL-backed attachment for export/import.</p>
|
||||
<p>The attachment in the export form; see <code>wire.attachment_to_dict</code>.</p>
|
||||
|
||||
|
||||
</div>
|
||||
@@ -8393,6 +8393,46 @@ the init data, and the byte range of the window. Returns None when the file has
|
||||
<div class="doc doc-object doc-function">
|
||||
|
||||
|
||||
<h3 id="unshackle.core.tracks.Track.pssh_order" class="doc doc-heading">
|
||||
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">pssh_order</span>
|
||||
|
||||
|
||||
<a href="#unshackle.core.tracks.Track.pssh_order" class="headerlink" title="Permanent link">¶</a></h3>
|
||||
<div class="language-python doc-signature highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">pssh_order</span><span class="p">(</span><span class="n">cdm</span><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Widevine and PlayReady, in the order to look for their PSSH.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="doc doc-object doc-function">
|
||||
|
||||
|
||||
<h3 id="unshackle.core.tracks.Track.drm_from_pssh" class="doc doc-heading">
|
||||
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">drm_from_pssh</span>
|
||||
|
||||
|
||||
<a href="#unshackle.core.tracks.Track.drm_from_pssh" class="headerlink" title="Permanent link">¶</a></h3>
|
||||
<div class="language-python doc-signature highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">drm_from_pssh</span><span class="p">(</span><span class="n">cdm</span><span class="p">,</span> <span class="n">read</span><span class="p">,</span> <span class="n">log</span><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Set drm to the first DRM that <code>read</code> finds a PSSH for, in pssh_order.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="doc doc-object doc-function">
|
||||
|
||||
|
||||
<h3 id="unshackle.core.tracks.Track.download" class="doc doc-heading">
|
||||
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">download</span>
|
||||
|
||||
@@ -8501,59 +8541,7 @@ This will overwrite anything at the target path.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Serialise the track for export/import (identity/URL/descriptor/language).</p>
|
||||
<p>DRM is not serialised here. The export writer attaches the licensed DRM + keys.
|
||||
Subclasses add their own codec/quality fields.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="doc doc-object doc-function">
|
||||
|
||||
|
||||
<h3 id="unshackle.core.tracks.Track.base_kwargs_from_dict" class="doc doc-heading">
|
||||
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">base_kwargs_from_dict</span>
|
||||
|
||||
|
||||
<span class="doc doc-labels">
|
||||
<small class="doc doc-label doc-label-staticmethod"><code>staticmethod</code></small>
|
||||
</span>
|
||||
|
||||
<a href="#unshackle.core.tracks.Track.base_kwargs_from_dict" class="headerlink" title="Permanent link">¶</a></h3>
|
||||
<div class="language-python doc-signature highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">base_kwargs_from_dict</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Assemble the shared Track constructor kwargs from a <code>to_dict()</code> payload.</p>
|
||||
<p>DRM is not reconstructed here: <code>to_dict</code> does not serialise it, and the import
|
||||
flow attaches the licensed DRM + content keys separately.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="doc doc-object doc-function">
|
||||
|
||||
|
||||
<h3 id="unshackle.core.tracks.Track.from_dict" class="doc doc-heading">
|
||||
<code class="doc-symbol doc-symbol-heading doc-symbol-method"></code> <span class="doc doc-object-name doc-function-name">from_dict</span>
|
||||
|
||||
|
||||
<span class="doc doc-labels">
|
||||
<small class="doc doc-label doc-label-classmethod"><code>classmethod</code></small>
|
||||
</span>
|
||||
|
||||
<a href="#unshackle.core.tracks.Track.from_dict" class="headerlink" title="Permanent link">¶</a></h3>
|
||||
<div class="language-python doc-signature highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="nf">from_dict</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
|
||||
</span></code></pre></div>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Reconstruct the correct Track subclass from a <code>to_dict()</code> payload.</p>
|
||||
<p>The track in the export form; see <code>wire.track_to_dict</code>.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -2104,7 +2104,8 @@
|
||||
<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
|
||||
@@ -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>
|
||||
|
||||
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-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/creating-a-service/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/service-architecture/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/authentication/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/dashboard/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/endpoints/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/errors/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/job-lifecycle/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/quickstart/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/dev/rest-api/remote-sessions/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/getting-started/configuration-file/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/getting-started/installation/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/getting-started/quickstart/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/cli-reference/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/downloading/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/drm-and-cdm/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/output-and-naming/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/proxies-and-vpn/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/subtitles/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/troubleshooting/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/guide/vaults/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/config/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/drm/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/service/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/titles/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/api/tracks/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/directories/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/download/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/drm/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/example/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/misc/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/network/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/output/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/post-scripts/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/services/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://docs.unshackle.dev/reference/configuration/vaults/</loc>
|
||||
<lastmod>2026-11-24</lastmod>
|
||||
<lastmod>2026-11-25</lastmod>
|
||||
</url>
|
||||
</urlset>
|
||||
Binary file not shown.
Reference in New Issue
Block a user