|
|
@@ -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>
|
|
|
|
<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">
|
|
|
|
<div class="admonition info">
|
|
|
|
<p class="admonition-title">Job states</p>
|
|
|
|
<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>
|
|
|
|
</div>
|
|
|
|
<h3 id="post-apidownload"><code>POST /api/download</code><a class="headerlink" href="#post-apidownload" title="Permanent link">¶</a></h3>
|
|
|
|
<h3 id="post-apidownload"><code>POST /api/download</code><a class="headerlink" href="#post-apidownload" title="Permanent link">¶</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>
|
|
|
|
<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>
|
|
|
|
<td>Split a track's segments across this many processes. Only engages for large batches.</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<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><code>downloads</code></td>
|
|
|
|
<td>int</td>
|
|
|
|
<td>int</td>
|
|
|
|
<td><code>1</code></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><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>
|
|
|
|
</span></code></pre></div>
|
|
|
|
<h3 id="slow-responses">Slow responses<a class="headerlink" href="#slow-responses" title="Permanent link">¶</a></h3>
|
|
|
|
<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
|
|
|
|
<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
|
|
|
|
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
|
|
|
|
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>
|
|
|
|
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/<sha1></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>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/<sha1></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><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>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://<resolver>@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://<resolver>@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-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-content">
|
|
|
|
<div class="tabbed-block">
|
|
|
|
<div class="tabbed-block">
|
|
|
@@ -5255,7 +5261,7 @@ A slow answer arrives as a <a href="#slow-responses">slow response</a>.</p>
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</table>
|
|
|
|
<h3 id="post-apisessionsession_idsegments"><code>POST /api/session/{session_id}/segments</code><a class="headerlink" href="#post-apisessionsession_idsegments" title="Permanent link">¶</a></h3>
|
|
|
|
<h3 id="post-apisessionsession_idsegments"><code>POST /api/session/{session_id}/segments</code><a class="headerlink" href="#post-apisessionsession_idsegments" title="Permanent link">¶</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-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-content">
|
|
|
|
<div class="tabbed-block">
|
|
|
|
<div class="tabbed-block">
|
|
|
@@ -5296,7 +5302,7 @@ A slow answer arrives as a <a href="#slow-responses">slow response</a>.</p>
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</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">¶</a></h3>
|
|
|
|
<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">¶</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-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-content">
|
|
|
|
<div class="tabbed-block">
|
|
|
|
<div class="tabbed-block">
|
|
|
|