Deployed 4bcc15df with MkDocs version: 1.6.1

This commit is contained in:
2026-11-29 23:50:33 +00:00
parent 2ea99e27f1
commit c14c48df8c
11 changed files with 347 additions and 240 deletions
+9 -6
View File
@@ -2676,8 +2676,8 @@ full detail:</p>
</tr>
<tr>
<td><code>speed</code></td>
<td>string</td>
<td>Transfer speed of the track in progress, e.g. <code>4.20 MB/s</code>.</td>
<td>string or <code>null</code></td>
<td>Transfer speed of the track in progress, e.g. <code>4.20 MB/s</code>. <code>null</code> when no track downloads.</td>
</tr>
<tr>
<td><code>skipped_subtitles</code></td>
@@ -2903,7 +2903,8 @@ download, and on finish stamps <code>completed_time</code> and records history.<
server process. For each job it spawns a separate Python subprocess:</p>
<div class="language-text highlight"><pre><span></span><code><span id="__span-7-1"><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a>python -m unshackle.core.api.download_worker &lt;payload.json&gt; &lt;result.json&gt; &lt;progress.json&gt;
</span></code></pre></div>
<p>Three temporary files bridge the parent and the job worker:</p>
<p>Three temporary files bridge the parent and the job worker. <code>unshackle/core/api/job_channel.py</code> defines each file
and the stdin answer line:</p>
<ul>
<li><strong><code>payload.json</code></strong>: the manager writes it before launch. It contains the job ID,
service, title ID, and merged parameters.</li>
@@ -2920,14 +2921,16 @@ the end of its prompt or notice sets it back to <code>null</code>.</p>
and blocking work inside the download engine, and makes hard cancellation (killing the
process) reliable.</p>
<p>The job worker's exit codes are <code>0</code> for success, <code>1</code> for a download error, and <code>2</code> for bad
arguments. Its <code>result.json</code> is either <code>{"status": "success", "output_files": [...]}</code>
or <code>{"status": "error", "message", "error_details", "error_code", "traceback"}</code>. If the
arguments. Its <code>result.json</code> holds <code>status</code>, <code>output_files</code>, <code>message</code>, <code>error_details</code>, <code>error_code</code> and
<code>traceback</code>. The <code>status</code> is <code>success</code> or <code>error</code>, and a success leaves the error fields <code>null</code>. If the
process exits non-zero, or the result is missing or not a success, the parent marks the
job <code>failed</code> and adopts the job worker's <code>error_code</code> (or derives one by categorising the
exception).</p>
<h3 id="how-progress-reaches-the-api">How progress reaches the API<a class="headerlink" href="#how-progress-reaches-the-api" title="Permanent link">&para;</a></h3>
<p>While the job worker operates, the manager polls <code>progress.json</code> every <strong>0.5 s</strong> and copies the
fields it finds onto the live <code>DownloadJob</code>. That is what the <code>GET</code> endpoints return.</p>
fields it finds onto the live <code>DownloadJob</code>. That is what the <code>GET</code> endpoints return. The file
holds the whole progress record each time, so each field in it replaces the job's value, <code>0</code> and
<code>null</code> too.</p>
<p>The job worker aggregates progress across all selected tracks. It weights each track's
completion fraction by its bitrate, so video and audio dominate the bar and subtitles
barely move it (subtitles get a small fixed weight). Track fractions are kept