mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-05 07:25:08 +00:00
Deployed 87b58190 with MkDocs version: 1.6.1
This commit is contained in:
+211
-202
@@ -16,7 +16,7 @@
|
||||
<link rel="prev" href="../subtitles/">
|
||||
|
||||
|
||||
<link rel="next" href="../../reference/configuration/">
|
||||
<link rel="next" href="../../dev/rest-api/">
|
||||
|
||||
|
||||
|
||||
@@ -347,28 +347,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-tabs__item">
|
||||
<a href="../../reference/api/service/" class="md-tabs__link">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
API Reference
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -616,6 +594,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1132,23 +1112,6 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Why is my config not being picked up?">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#logging-conventions-when-adding-entries" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
Logging conventions when adding entries
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1160,6 +1123,174 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
|
||||
|
||||
|
||||
|
||||
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_9" >
|
||||
|
||||
|
||||
<div class="md-nav__link md-nav__container">
|
||||
<a href="../../dev/rest-api/" class="md-nav__link ">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
|
||||
|
||||
Server
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
<label class="md-nav__link " for="__nav_3_9" id="__nav_3_9_label" tabindex="">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_9_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_3_9">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
|
||||
|
||||
Server
|
||||
|
||||
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../dev/rest-api/authentication/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
|
||||
|
||||
Authentication
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../dev/rest-api/dashboard/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
|
||||
|
||||
Dashboard
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../remote-sessions/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
|
||||
|
||||
Remote Sessions
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
@@ -1352,7 +1483,7 @@
|
||||
<span class="md-ellipsis">
|
||||
|
||||
|
||||
Output & Naming
|
||||
Output & Naming Options
|
||||
|
||||
|
||||
|
||||
@@ -1436,7 +1567,7 @@
|
||||
<span class="md-ellipsis">
|
||||
|
||||
|
||||
Key Vaults
|
||||
Key Vault Options
|
||||
|
||||
|
||||
|
||||
@@ -1556,6 +1687,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1667,14 +1800,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1700,9 +1825,8 @@
|
||||
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_3" >
|
||||
|
||||
|
||||
<div class="md-nav__link md-nav__container">
|
||||
<a href="../../dev/rest-api/" class="md-nav__link ">
|
||||
|
||||
<label class="md-nav__link" for="__nav_5_3" id="__nav_5_3_label" tabindex="0">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
@@ -1716,14 +1840,8 @@
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
<label class="md-nav__link " for="__nav_5_3" id="__nav_5_3_label" tabindex="0">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_3_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_5_3">
|
||||
@@ -1737,8 +1855,6 @@
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1752,35 +1868,7 @@
|
||||
<span class="md-ellipsis">
|
||||
|
||||
|
||||
Quick Start
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../dev/rest-api/authentication/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
|
||||
|
||||
Authentication
|
||||
REST API Quick Start
|
||||
|
||||
|
||||
|
||||
@@ -1857,14 +1945,14 @@
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../dev/rest-api/dashboard/" class="md-nav__link">
|
||||
<a href="../../dev/rest-api/errors/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
|
||||
|
||||
Dashboard
|
||||
Error Responses
|
||||
|
||||
|
||||
|
||||
@@ -1892,7 +1980,7 @@
|
||||
<span class="md-ellipsis">
|
||||
|
||||
|
||||
Remote Sessions
|
||||
Remote Session Protocol
|
||||
|
||||
|
||||
|
||||
@@ -1906,55 +1994,20 @@
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../dev/rest-api/errors/" class="md-nav__link">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
|
||||
|
||||
Error Responses
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1981,17 +2034,17 @@
|
||||
|
||||
|
||||
|
||||
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" >
|
||||
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5_4" >
|
||||
|
||||
|
||||
<label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
|
||||
<label class="md-nav__link" for="__nav_5_4" id="__nav_5_4_label" tabindex="0">
|
||||
|
||||
|
||||
|
||||
<span class="md-ellipsis">
|
||||
|
||||
|
||||
API Reference
|
||||
Python API
|
||||
|
||||
|
||||
|
||||
@@ -2002,12 +2055,12 @@
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
</label>
|
||||
|
||||
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_6">
|
||||
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_4_label" aria-expanded="false">
|
||||
<label class="md-nav__title" for="__nav_5_4">
|
||||
<span class="md-nav__icon md-icon"></span>
|
||||
|
||||
|
||||
API Reference
|
||||
Python API
|
||||
|
||||
|
||||
</label>
|
||||
@@ -2159,6 +2212,14 @@
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
@@ -2389,23 +2450,6 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="md-nav" aria-label="Why is my config not being picked up?">
|
||||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#logging-conventions-when-adding-entries" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
|
||||
Logging conventions when adding entries
|
||||
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -2488,7 +2532,7 @@
|
||||
<div class="language-json highlight"><pre><span></span><code><span id="__span-4-1"><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><span class="p">{</span><span class="nt">"timestamp"</span><span class="p">:</span><span class="s2">"2026-07-03T14:25:30.123456+00:00"</span><span class="p">,</span><span class="nt">"session_id"</span><span class="p">:</span><span class="s2">"a1b2c3d4"</span><span class="p">,</span><span class="nt">"level"</span><span class="p">:</span><span class="s2">"INFO"</span><span class="p">,</span><span class="nt">"operation"</span><span class="p">:</span><span class="s2">"session_start"</span><span class="p">,</span><span class="nt">"message"</span><span class="p">:</span><span class="s2">"Debug logging session started"</span><span class="p">,</span><span class="nt">"context"</span><span class="p">:{</span><span class="nt">"unshackle_version"</span><span class="p">:</span><span class="s2">"5.3.0"</span><span class="p">,</span><span class="nt">"unshackle_code_hash"</span><span class="p">:</span><span class="s2">"1d22a1e"</span><span class="p">,</span><span class="nt">"python_version"</span><span class="p">:</span><span class="s2">"3.12.4 ..."</span><span class="p">,</span><span class="nt">"platform"</span><span class="p">:</span><span class="s2">"Linux-6.18.5-x86_64"</span><span class="p">,</span><span class="nt">"platform_system"</span><span class="p">:</span><span class="s2">"Linux"</span><span class="p">,</span><span class="nt">"platform_release"</span><span class="p">:</span><span class="s2">"6.18.5"</span><span class="p">}}</span>
|
||||
</span></code></pre></div>
|
||||
<p>Quote <code>unshackle_code_hash</code> in a bug report. It fingerprints the framework source you operate, so it tells us the exact code state even when you did not install from git. A hash that matches no release means that someone edited the source locally.</p>
|
||||
<p>Subsequent lines record the operations: service calls, DRM licence requests, vault lookups, downloader progress, and errors. Common fields include:</p>
|
||||
<p>Subsequent lines record the operations: service calls, DRM challenges and licences, vault lookups, downloader progress, and errors. Common fields include:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -2798,7 +2842,7 @@
|
||||
<div class="admonition example">
|
||||
<p class="admonition-title">The wrong titles/metadata keep coming back</p>
|
||||
<p><strong>Symptom:</strong> a service returns outdated titles even after the source changed.</p>
|
||||
<p><strong>Inspect:</strong> the title cache is likely serving stale data. Clear it with <code>unshackle env clear cache <SERVICE></code>, or bypass it for one run using the <code>dl</code> no-cache / reset-cache options (see <a href="../downloading/">Downloading</a> and the <a href="../cli-reference/#dl">CLI Reference</a>).</p>
|
||||
<p><strong>Inspect:</strong> the title cache is likely serving stale data. Clear it with <code>unshackle env clear cache <SERVICE></code>, or bypass it for one run using the <code>dl</code> no-cache / reset-cache options (see the <a href="../cli-reference/#concurrency-caching-listing">CLI Reference</a>).</p>
|
||||
</div>
|
||||
<div class="admonition example">
|
||||
<p class="admonition-title">A config value doesn't seem to apply</p>
|
||||
@@ -2807,43 +2851,8 @@
|
||||
</div>
|
||||
<hr />
|
||||
<h2 id="why-is-my-config-not-being-picked-up">Why is my config not being picked up?<a class="headerlink" href="#why-is-my-config-not-being-picked-up" title="Permanent link">¶</a></h2>
|
||||
<p>unshackle loads the <strong>first</strong> <code>unshackle.yaml</code> it finds, in this order:</p>
|
||||
<ol>
|
||||
<li><code>unshackle.yaml</code> inside the package's namespace directory.</li>
|
||||
<li><code>unshackle.yaml</code> in the parent of that directory.</li>
|
||||
<li><code>unshackle.yaml</code> in your OS user-config directory: on Linux <code>~/.config/unshackle/unshackle.yaml</code>, on Windows <code>%LOCALAPPDATA%\unshackle\unshackle.yaml</code>, on macOS <code>~/Library/Application Support/unshackle/unshackle.yaml</code>.</li>
|
||||
</ol>
|
||||
<p>If you have config in more than one of these, an earlier one wins and unshackle silently ignores your edits to a later file. <code>unshackle env info</code> prints the path it loaded (or, if none exists, shows all three candidate locations so you can make the file correctly). See <a href="../cli-reference/#cfg">Configuration</a> for editing values with the <code>cfg</code> command.</p>
|
||||
<hr />
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Developer note: structured logging in code</p>
|
||||
<p>Service and command code sends entries through the shared <code>log_event(...)</code> helper (and the <code>timed_operation(...)</code> context manager for timing a block) from <code>unshackle.core.utilities</code>. These are no-ops when you disable debug logging, so they are always safe to leave in place. When you add a new feature, call <code>log_event("my_feature_event", message="...", context={...})</code>. Do not write the "is the logger enabled?" guard again. unshackle does the redaction and the JSON-serialisation for you, and redacts any field whose name looks like a content key, a secret, or a token. Content keys only appear when the run has <code>debug_keys</code> enabled.</p>
|
||||
</div>
|
||||
<h3 id="logging-conventions-when-adding-entries">Logging conventions when adding entries<a class="headerlink" href="#logging-conventions-when-adding-entries" title="Permanent link">¶</a></h3>
|
||||
<p>The debug log is tuned for <strong>developers troubleshooting pipeline flow</strong> (maximum signal, minimum noise), not for end users. A few conventions keep it that way. The <code>log_event</code> signature does not enforce them, so they are easy to miss and worth stating explicitly.</p>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">Log levels are a flow skeleton, not just severity</p>
|
||||
<p>Treat <code>level</code> as structure, not decoration. Send exactly <strong>one <code>INFO</code> milestone per pipeline stage</strong> so that <code>jq 'select(.level=="INFO")'</code> reads back the whole end-to-end flow of a run. Everything internal goes to <code>DEBUG</code>. Failures go to <code>ERROR</code>. A sparse <code>INFO</code> is the whole point. It is the line a developer skims first to see where a run got to before it broke.</p>
|
||||
<div class="language-console highlight"><pre><span></span><code><span id="__span-15-1"><a id="__codelineno-15-1" name="__codelineno-15-1" href="#__codelineno-15-1"></a><span class="gp"># </span>Read<span class="w"> </span>the<span class="w"> </span>pipeline<span class="err">'</span>s<span class="w"> </span>high-level<span class="w"> </span>flow,<span class="w"> </span>one<span class="w"> </span>line<span class="w"> </span>per<span class="w"> </span>stage
|
||||
</span><span id="__span-15-2"><a id="__codelineno-15-2" name="__codelineno-15-2" href="#__codelineno-15-2"></a><span class="go">jq 'select(.level == "INFO")' unshackle_debug_EXAMPLE_20260703-142530.jsonl</span>
|
||||
</span></code></pre></div>
|
||||
</div>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">No request bodies and no raw dumps</p>
|
||||
<p>A <code>log_event</code> entry never holds a request body or a raw dump: no full <code>Tracks</code> object, no MPD/manifest body and no response payload. Only <code>debug_requests</code> records request and response bodies, and only as files in its separate body folder. Log only <strong>counts, ids, sizes, and <code>safe_display_url(url)</code></strong>. This keeps the log low-noise and prevents leaking title or manifest data into the file <em>before</em> redaction even runs. Redaction is a backstop, not a licence to dump raw objects.</p>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Operation names: <code><area>_<event></code>, no registry</p>
|
||||
<p>Operation names are plain lowercase strings that follow an <code><area>_<event></code> convention: <code>manifest_dash_parse</code>, <code>drm_decrypt</code>, <code>vault_get_key</code>, <code>tool_run</code>. We write them inline at each call site on purpose. There is <strong>no central registry or enum</strong>. Do not look for one, and do not make one. The absence is a deliberate design choice, not an omission.</p>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">Message reads alone; data lives in fields</p>
|
||||
<p>Give every entry a single-sentence <code>message</code> that stands on its own. Put all structured data (<code>context</code>, counts, ids, <code>duration_ms</code>) in <strong>fields</strong>, not in the prose. This separation lets the log be both human-scannable and machine-filterable. A message like <code>"Parsed DASH manifest"</code> with <code>context={"video": 4, "audio": 2}</code> beats <code>"Parsed manifest with 4 video and 2 audio tracks"</code>.</p>
|
||||
</div>
|
||||
<div class="admonition tip">
|
||||
<p class="admonition-title">Let tool runs log themselves</p>
|
||||
<p>For external-tool calls (FFmpeg, mkvmerge, <code>dovi_tool</code>, and friends), route through <code>run_step</code> / <code>run_tool</code> / <code>ffprobe</code>, which auto-emit a <code>tool_run</code> entry capturing the binary's version, return code, and duration consistently. <code>run_tool</code> also raises <code>ToolFailed</code>, whose message names the tool, the exit code and the last lines the tool wrote. A failure that the caller recovers from (a retry, a fallback) is named with <code>handled=</code> (exit codes or stderr text): its <code>tool_run</code> entry is <code>DEBUG</code>, not <code>ERROR</code>, and the call still raises. Only fall back to calling <code>log_tool_run</code> manually for a direct <code>subprocess.run</code> you genuinely cannot route through those helpers. Auto-logging is the preferred path precisely because it captures those fields the same way every time.</p>
|
||||
</div>
|
||||
<p>unshackle loads the <strong>first</strong> <code>unshackle.yaml</code> it finds, in the order that <a href="../../getting-started/configuration-file/#where-the-config-file-lives">Where the config file lives</a> gives.</p>
|
||||
<p>If you have config in more than one of those locations, an earlier one wins and unshackle silently ignores your edits to a later file. <code>unshackle env info</code> prints the path it loaded (or, if none exists, shows every candidate location so you can make the file correctly). See <a href="../cli-reference/#cfg">Configuration</a> for editing values with the <code>cfg</code> command.</p>
|
||||
|
||||
|
||||
|
||||
@@ -2898,13 +2907,13 @@
|
||||
|
||||
|
||||
|
||||
<a href="../../reference/configuration/" class="md-footer__link md-footer__link--next" aria-label="Next: Overview">
|
||||
<a href="../../dev/rest-api/" class="md-footer__link md-footer__link--next" aria-label="Next: Server Overview">
|
||||
<div class="md-footer__title">
|
||||
<span class="md-footer__direction">
|
||||
Next
|
||||
</span>
|
||||
<div class="md-ellipsis">
|
||||
Overview
|
||||
Server Overview
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-footer__button md-icon">
|
||||
|
||||
Reference in New Issue
Block a user