Deployed f4d178c2 with MkDocs version: 1.6.1

This commit is contained in:
2026-11-29 04:49:58 +00:00
parent 6c4ecc8e75
commit ae027db763
7 changed files with 43 additions and 24 deletions
+2 -2
View File
@@ -2322,8 +2322,8 @@ label is the <code>username</code> from the <code>users</code> entry when one is
characters of the API key.</p>
<h2 id="event-stream">Event stream<a class="headerlink" href="#event-stream" title="Permanent link">&para;</a></h2>
<p><code>/api/dashboard/events</code> sends a <code>stats</code> event (the same body as <code>/status</code>) on connect and
then every 5 seconds, so the connection stays alive and the counters stay current. Between
those it sends:</p>
then every 5 seconds, so the connection stays alive and the counters stay current. The server
closes the connection when it stops. Between those it sends:</p>
<table>
<thead>
<tr>
+11 -5
View File
@@ -3851,7 +3851,7 @@ ignore it safely. See <a href="../../creating-a-service/#split-episodes">Split e
<p>Downloads are asynchronous. <code>POST /api/download</code> enqueues a job and returns immediately with a <code>job_id</code>. The server runs each job in a background job worker subprocess. You then poll the job endpoints for progress and results.</p>
<div class="admonition info">
<p class="admonition-title">Job states</p>
<p>A job moves through <code>queued</code> → <code>downloading</code> → one of the terminal states <code>completed</code>, <code>failed</code>, or <code>cancelled</code>. You can prioritise only queued jobs. You can retry or remove only terminal jobs.</p>
<p>A job moves through <code>queued</code> → <code>downloading</code> → one of the terminal states <code>completed</code>, <code>failed</code>, or <code>cancelled</code>. You can prioritise only queued jobs. You can retry or remove only terminal jobs. When the server stops, it cancels each queued and downloading job and refuses a new job with <code>SERVER_DRAINING</code> (409).</p>
</div>
<h3 id="post-apidownload"><code>POST /api/download</code><a class="headerlink" href="#post-apidownload" title="Permanent link">&para;</a></h3>
<p>Make a download job. It requires <code>service</code> and <code>title_id</code>. Every other field is an optional download parameter with a server-side default. On success this returns <strong><code>202 Accepted</code></strong>, not <code>200</code>.</p>
@@ -4139,6 +4139,12 @@ ignore it safely. See <a href="../../creating-a-service/#split-episodes">Split e
<td>Split a track's segments across this many processes. Only engages for large batches.</td>
</tr>
<tr>
<td><code>continue_downloads</code></td>
<td>boolean</td>
<td><code>false</code></td>
<td>Keep the completed segment files across runs and resume a download that failed before.</td>
</tr>
<tr>
<td><code>downloads</code></td>
<td>int</td>
<td><code>1</code></td>
@@ -4975,7 +4981,7 @@ answers the prompt within 10 minutes.</p>
</span><span id="__span-30-12"><a id="__codelineno-30-12" name="__codelineno-30-12" href="#__codelineno-30-12"></a>DELETE /api/session/{id} → tear down, harvest updated cache
</span></code></pre></div>
<h3 id="slow-responses">Slow responses<a class="headerlink" href="#slow-responses" title="Permanent link">&para;</a></h3>
<p>The <code>titles</code>, <code>tracks</code> and <code>license</code> routes can take minutes on a large catalogue. When the
<p>The <code>titles</code>, <code>tracks</code>, <code>segments</code> and <code>license</code> routes can take minutes on a large catalogue. When the
answer is not ready after 30 seconds, the route sends status <code>200</code> and the headers. It then
sends a newline every 30 seconds until the JSON body is ready. JSON parsers ignore the leading
newlines. This keeps the connection open through a reverse proxy that closes an idle request.</p>
@@ -4992,7 +4998,7 @@ the newlines must go out at once.</p>
<p>Make a remote session for a service and title. Authentication runs asynchronously in the background. This call returns immediately with <code>status: "authenticating"</code>, and you then poll the prompt endpoint. The body accepts <code>service</code> and <code>title_id</code> (both required). It also accepts a broad set of optional keys, because the body allows <code>additionalProperties</code>. These are <code>credentials</code> (<code>{username, password, extra?}</code>), <code>cookies</code> (base64 of zlib-compressed Netscape cookie file), <code>proxy</code>, <code>no_proxy</code>, <code>profile</code>, <code>cache</code> (map of forwarded cache files, keyed by the file path relative to the service cache directory with <code>/</code> separators and no <code>.json</code> suffix, so a nested key such as <code>session_web/&lt;sha1&gt;</code> lands in a subdirectory), <code>client_region</code>, <code>proxy_region</code>, <code>cdm_type</code>, <code>range_</code>, <code>vcodec</code>, <code>quality</code>, <code>best_available</code>, <code>dl_params</code>, <code>client</code>, and any service CLI options. <code>proxy_region</code> is the country code the client resolved <code>proxy</code> from; the server matches it against its own accounts. <code>client</code> is a freeform object the dashboard shows as sent (the CLI puts <code>version</code>, <code>code_hash</code>, <code>platform</code> and a redacted <code>argv</code> in it); the server ignores it above 4096 bytes of JSON.</p>
<p><code>dl_params</code> is an object with the <code>dl</code> track selection: <code>lang</code>, <code>v_lang</code>, <code>a_lang</code> and <code>s_lang</code> (arrays of language strings), <code>acodec</code> (an array of audio codec names or <code>dl -a</code> aliases such as <code>ddp</code>), and <code>forced_subs</code> and <code>exact_lang</code> (booleans). The service reads these values from <code>ctx.parent.params</code>. The server uses the <code>dl</code> default for each absent value. It refuses a malformed value, an unknown codec, range or vcodec name, and a height of 0 or less with <code>INVALID_PARAMETERS</code>. The flat <code>range_</code>, <code>vcodec</code>, <code>quality</code>, <code>best_available</code> and <code>generate_dv</code> keys are <code>dl</code> values on this route. On the list and search routes they are <code>dl</code> values only when the body has <code>service_params</code>.</p>
<p>Service CLI options also travel in a nested <code>service_params</code> object. When the body has <code>service_params</code>, the server reads service options only from it, and a flat key with the same name stays a <code>dl</code> value. <code>profile</code> at the top level always means the credentials profile, never a service's own <code>--profile</code> option.</p>
<p>The <code>proxy</code> value must be a full proxy URI, unless the operator gives your API key <code>server_proxy</code> in the <code>serve.users</code> config. Without <code>server_proxy</code>, a proxy URI gets <code>INVALID_PROXY</code> when its host is not a public address or is not a plain host name or IP address. Without <code>server_proxy</code>, the server does not resolve country codes with its own proxy providers. It rejects the request with <code>INVALID_PROXY</code> when no <code>proxy</code> is set and the reported <code>client_region</code> differs from the server's region. A request that reports no <code>client_region</code> is not blocked. Pass <code>proxy</code> with your own proxy, or <code>no_proxy</code> to accept the server's own connection. With <code>server_proxy</code>, the server resolves a country code and picks a proxy for your <code>client_region</code> itself. A Control D resolver, <code>controld://&lt;resolver&gt;@dns.controld.com</code>, counts as a full proxy URI: the server runs a forwarder for it and needs no Control D configuration of its own. A proxy URI needs an <code>http</code>, <code>https</code> or <code>socks</code> scheme: the server answers <code>INVALID_PROXY</code> to a <code>host:port</code> value, also with <code>server_proxy</code>.</p>
<p>The <code>proxy</code> value must be a full proxy URI, unless the operator gives your API key <code>server_proxy</code> in the <code>serve.users</code> config. Without <code>server_proxy</code>, a proxy URI gets <code>INVALID_PROXY</code> when its host is not a public address, does not resolve, or is not a plain host name or IP address. Without <code>server_proxy</code>, the server does not resolve country codes with its own proxy providers. It rejects the request with <code>INVALID_PROXY</code> when no <code>proxy</code> is set and the reported <code>client_region</code> differs from the server's region. A request that reports no <code>client_region</code> is not blocked. Pass <code>proxy</code> with your own proxy, or <code>no_proxy</code> to accept the server's own connection. With <code>server_proxy</code>, the server resolves a country code and picks a proxy for your <code>client_region</code> itself. A Control D resolver, <code>controld://&lt;resolver&gt;@dns.controld.com</code>, counts as a full proxy URI: the server runs a forwarder for it and needs no Control D configuration of its own. A proxy URI needs an <code>http</code>, <code>https</code> or <code>socks</code> scheme: the server answers <code>INVALID_PROXY</code> to a <code>host:port</code> value, also with <code>server_proxy</code>.</p>
<div class="tabbed-set tabbed-alternate" data-tabs="20:1"><input checked="checked" id="__tabbed_20_1" name="__tabbed_20" type="radio" /><div class="tabbed-labels"><label for="__tabbed_20_1">Response <code>200</code></label></div>
<div class="tabbed-content">
<div class="tabbed-block">
@@ -5255,7 +5261,7 @@ A slow answer arrives as a <a href="#slow-responses">slow response</a>.</p>
</tbody>
</table>
<h3 id="post-apisessionsession_idsegments"><code>POST /api/session/{session_id}/segments</code><a class="headerlink" href="#post-apisessionsession_idsegments" title="Permanent link">&para;</a></h3>
<p>Get the download URL, DRM info, headers, cookies, and raw track data for the selected tracks. Body: <code>{ "track_ids": ["v-1", "a-1"] }</code> (required).</p>
<p>Get the download URL, DRM info, headers, cookies, and raw track data for the selected tracks. Body: <code>{ "track_ids": ["v-1", "a-1"] }</code> (required). A track that the tracks response sent with <code>resolve_url</code> gets its URL from the service here. The server makes one service call at a time per remote session, so parallel requests wait for each other. A slow answer arrives as described in <a href="#slow-responses">Slow responses</a>.</p>
<div class="tabbed-set tabbed-alternate" data-tabs="26:1"><input checked="checked" id="__tabbed_26_1" name="__tabbed_26" type="radio" /><div class="tabbed-labels"><label for="__tabbed_26_1">Response <code>200</code></label></div>
<div class="tabbed-content">
<div class="tabbed-block">
@@ -5296,7 +5302,7 @@ A slow answer arrives as a <a href="#slow-responses">slow response</a>.</p>
</tbody>
</table>
<h3 id="post-apisessionsession_idsegment_filter"><code>POST /api/session/{session_id}/segment_filter</code><a class="headerlink" href="#post-apisessionsession_idsegment_filter" title="Permanent link">&para;</a></h3>
<p>Get the HLS segments a service drops (ads, bumpers, dub cards). The server runs the service's own segment filter over the track's media playlist and returns only the URIs, so the client drops the same segments the service does. Body: <code>{ "track_id": "v-1" }</code> (required). <code>unwanted</code> is <code>null</code> when the track has no filter. The client keeps every segment when the server does not have this route.</p>
<p>Get the HLS segments a service drops (ads, bumpers, dub cards). The server runs the service's own segment filter over the track's media playlist and returns only the URIs, so the client drops the same segments the service does. Body: <code>{ "track_id": "v-1" }</code> (required). <code>unwanted</code> is <code>null</code> when the track has no filter. The client keeps every segment when the server does not have this route. When the server answers with an error, the client stops the track download.</p>
<div class="tabbed-set tabbed-alternate" data-tabs="27:1"><input checked="checked" id="__tabbed_27_1" name="__tabbed_27" type="radio" /><div class="tabbed-labels"><label for="__tabbed_27_1">Response <code>200</code></label></div>
<div class="tabbed-content">
<div class="tabbed-block">
+16 -11
View File
@@ -3163,8 +3163,9 @@ request finds the remote session gone.</p>
<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
empty parent dirs up to, but not including, the cache root).</li>
<li>The server calls <strong><code>cancel_all_bridges()</code></strong> on shutdown, to unblock any waiting
auth threads.</li>
<li>The server calls <strong><code>cancel_all_bridges()</code></strong> on shutdown. It ends each open remote session, which
unblocks any waiting auth threads, and deletes the cache directory of each one. The server then waits up
to 5 seconds for each login that still runs, and deletes its cache directory again when it ends.</li>
</ul>
<p><code>SessionEntry</code> fields:</p>
<table>
@@ -3298,14 +3299,14 @@ the error codes and the request and reply shapes that it shares with the server
closes its remote session, so the drain can end and the refreshed cache comes back.
It waits until <code>/api/health</code> reports the restarted server without <code>draining</code>,
opens a new remote session, and continues with the next title.</li>
<li>A lost remote session (<code>SESSION_NOT_FOUND</code>, a connection error, a timeout, a closed
tunnel or a gateway error page): the client waits for <code>/api/health</code>, then checks the
old remote session. A live remote session takes the call again only after a connection
error, because a timed-out call can already have run. A lost one is replaced: the
<li>A lost remote session (<code>SESSION_NOT_FOUND</code>, a connection error, an answer cut off
after its headers, a timeout, a closed tunnel or a gateway error page): the client waits
for <code>/api/health</code>, then checks the old remote session. A live remote session takes the
call again only after a connection error, because a timed-out call can already have run.
A cut-off answer counts as a connection error, so the server can run that call twice. A lost one is replaced: the
client opens a new remote session, sends <code>titles</code> and the current title's <code>tracks</code>
again, and then sends the failed call again. A title or track that the new remote
session gives another ID keeps its old ID on the client, and the client sends the
new ID. The client matches a title by season and episode number, and a track by its
again, and then sends the failed call again. A title or track that the new remote session
gives another ID keeps its old ID on the client, and the client sends the new ID. The client matches a title by season and episode number, and a track by its
attributes.</li>
</ul>
<p>The client waits up to 30 minutes for the server, which covers a deploy's drain. It
@@ -3313,8 +3314,12 @@ stops with an error if the new remote session licenses differently from the old
for example after a change to the API key's <code>server_cdm</code> grant. An interactive login
asks for its input again.
- <strong>Server resolution.</strong> <code>resolve_server()</code> reads <code>config.remote_services.&lt;name&gt;</code>
into <code>{url, api_key, services, server_cdm}</code>, injecting the <code>server_cdm</code> flag into
the services map as <code>_server_cdm</code>.</p>
into <code>{url, api_key, services, server_cdm}</code>. It puts the <code>server_cdm</code> flag into a
copy of the services map as <code>_server_cdm</code>, and never changes the loaded config.
- <strong>Optional routes.</strong> A call to a route that an older server can lack (the segment filter,
bad content key reports, the log poll) counts as empty only when the server answers 404
with no <code>error_code</code>. Any other error stops the call: a segment filter that fails on the
server stops the track download, and the client never keeps every segment in its place.</p>
</li>
</ul>
<hr />