Deployed 87b58190 with MkDocs version: 1.6.1

This commit is contained in:
2026-12-05 03:00:15 +00:00
parent 56cac92f20
commit 6ed040a6dd
44 changed files with 17665 additions and 13063 deletions
+535 -147
View File
@@ -27,7 +27,7 @@
<title>Output & Naming - unshackle</title>
<title>Output & Naming Options - unshackle</title>
@@ -116,7 +116,7 @@
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Output & Naming
Output & Naming Options
</span>
</div>
@@ -347,28 +347,6 @@
<li class="md-tabs__item">
<a href="../../api/service/" class="md-tabs__link">
API Reference
</a>
</li>
</ul>
</div>
</nav>
@@ -614,6 +592,8 @@
@@ -886,6 +866,171 @@
<li class="md-nav__item 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="0">
<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="../../../guide/remote-sessions/" class="md-nav__link">
<span class="md-ellipsis">
Remote Sessions
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
@@ -1092,7 +1237,7 @@
<span class="md-ellipsis">
Output & Naming
Output & Naming Options
@@ -1110,7 +1255,7 @@
<span class="md-ellipsis">
Output & Naming
Output & Naming Options
@@ -1144,6 +1289,23 @@
</span>
</a>
<nav class="md-nav" aria-label="output_template">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#template-variables" class="md-nav__link">
<span class="md-ellipsis">
Template variables
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
@@ -1286,7 +1448,7 @@
<span class="md-ellipsis">
Key Vaults
Key Vault Options
@@ -1406,6 +1568,8 @@
@@ -1517,14 +1681,6 @@
@@ -1550,9 +1706,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">
@@ -1566,14 +1721,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">
@@ -1587,8 +1736,6 @@
<ul class="md-nav__list" data-md-scrollfix>
@@ -1602,35 +1749,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
@@ -1707,14 +1826,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
@@ -1742,7 +1861,7 @@
<span class="md-ellipsis">
Remote Sessions
Remote Session Protocol
@@ -1756,55 +1875,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>
@@ -1831,17 +1915,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
@@ -1852,12 +1936,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>
@@ -2009,6 +2093,14 @@
</li>
</ul>
</nav>
</li>
</ul>
</nav>
@@ -2045,6 +2137,23 @@
</span>
</a>
<nav class="md-nav" aria-label="output_template">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#template-variables" class="md-nav__link">
<span class="md-ellipsis">
Template variables
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
@@ -2128,18 +2237,54 @@
<h1 id="output-naming">Output &amp; naming<a class="headerlink" href="#output-naming" title="Permanent link">&para;</a></h1>
<h1 id="output-naming">Output &amp; Naming<a class="headerlink" href="#output-naming" title="Permanent link">&para;</a></h1>
<p>Keys that control the output filename, the per-title subfolder, release-group tagging, and
filename character handling. For template cookbook material and worked naming examples, see
filename character handling. For how unshackle builds a path, and for worked naming examples, see
the <a href="../../../guide/output-and-naming/">Output &amp; naming guide</a>.</p>
<h2 id="output_template"><code>output_template</code><a class="headerlink" href="#output_template" title="Permanent link">&para;</a></h2>
<ul>
<li><strong>Type:</strong> <code>dict</code> &nbsp;·&nbsp; <strong>Required</strong> (no usable default; <code>dl</code> exits with an error if this is missing)</li>
</ul>
<p>Filename templates keyed by media kind, using <code>{variable}</code> placeholders. Recognised kinds are
<code>movies</code>, <code>series</code>, <code>sports</code>, and <code>songs</code> (and <code>albums</code> for folder templates). A trailing <code>?</code> on a
variable (e.g. <code>{quality?}</code>) marks it optional: if empty, it and one adjacent separator are
<p>Filename templates keyed by media kind, using <code>{variable}</code> placeholders. <code>dl</code> stops with
<code>No 'output_template' in your unshackle.yaml</code> when the config key is missing or empty. A trailing <code>?</code> on
a variable (e.g. <code>{quality?}</code>) marks it optional: if empty, it and one adjacent separator are
dropped.</p>
<table>
<thead>
<tr>
<th>Kind</th>
<th>Applies to</th>
<th>When unset</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>movies</code></td>
<td>Movies</td>
<td>The title name and year, with spaces: <code>The Movie (2024)</code>.</td>
</tr>
<tr>
<td><code>series</code></td>
<td>TV episodes</td>
<td>The show, year, episode number and name, with spaces: <code>The Show 2024 S01E05 Pilot</code>.</td>
</tr>
<tr>
<td><code>sports</code></td>
<td>Episodes that the service marks as a sports event</td>
<td>The <code>series</code> template.</td>
</tr>
<tr>
<td><code>songs</code></td>
<td>Songs</td>
<td><code>"{track_number}. {title}"</code></td>
</tr>
<tr>
<td><code>albums</code></td>
<td>Album folders, in <code>folder</code> only</td>
<td>The <code>songs</code> folder template, then a single-string <code>folder</code>, then <code>"{artist} - {album} ({year})"</code>, or <code>"{artist} - {album}"</code> with no year.</td>
</tr>
</tbody>
</table>
<div class="language-yaml highlight"><span class="filename">unshackle.yaml</span><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="nt">output_template</span><span class="p">:</span>
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="w"> </span><span class="nt">movies</span><span class="p">:</span><span class="w"> </span><span class="s">"{title}.{year}.{quality?}.{source}-{tag}"</span>
</span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="w"> </span><span class="nt">series</span><span class="p">:</span><span class="w"> </span><span class="s">"{title}.{season_episode}.{episode_name?}.{quality?}.{source}-{tag}"</span>
@@ -2159,15 +2304,258 @@ dropped.</p>
<p>unshackle validates templates on load and emits warnings for unknown variables, non-string
values, filesystem-unsafe characters (<code>&lt; &gt; : " / \ | ? *</code>), empty templates, and unknown
folder-kind keys.</p>
<details class="example">
<summary>All valid template variables</summary>
<p><code>title</code>, <code>year</code>, <code>season</code>, <code>episode</code>, <code>season_episode</code>, <code>episode_name</code>, <code>part</code>,
<code>absolute</code>, <code>date</code>, <code>quality</code>, <code>resolution</code>, <code>source</code>, <code>tag</code>, <code>track_number</code>, <code>artist</code>,
<code>album_artist</code>, <code>album</code>, <code>disc</code>, <code>track_total</code>, <code>disc_total</code>, <code>release_type</code>, <code>genre</code>,
<code>explicit</code>, <code>isrc</code>, <code>upc</code>, <code>label</code>, <code>audio</code>, <code>audio_channels</code>, <code>audio_full</code>, <code>atmos</code>,
<code>dual</code>, <code>multi</code>, <code>dubbed</code>, <code>video</code>, <code>hdr</code>, <code>hfr</code>, <code>3d</code>, <code>edition</code>, <code>repack</code>, <code>lang_tag</code>,
<code>title_type</code>.</p>
</details>
<h3 id="template-variables">Template variables<a class="headerlink" href="#template-variables" title="Permanent link">&para;</a></h3>
<p>unshackle takes the values from the downloaded media (through MediaInfo), from the title
metadata, or from your config. A variable that does not apply to a title becomes an empty
string. The common and audio variables work in every template. The episode variables belong to
the <code>series</code> and <code>sports</code> templates, and the music variables to the <code>songs</code> and <code>albums</code>
templates. unshackle warns at startup about such a variable in another template, also in a
single-string <code>folder</code> template, which still fills it in for the titles that have it.</p>
<p><strong>Common and video</strong></p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Meaning</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>title</code></td>
<td>Title name (movie/show/song name; <code>$</code> is rendered as <code>S</code>)</td>
<td><code>The Show</code></td>
</tr>
<tr>
<td><code>title_type</code></td>
<td>Media kind of the title</td>
<td><code>movie</code>, <code>series</code>, <code>music</code></td>
</tr>
<tr>
<td><code>year</code></td>
<td>Release year</td>
<td><code>2024</code></td>
</tr>
<tr>
<td><code>source</code></td>
<td>Service tag / class name (empty with <code>--no-source</code>)</td>
<td><code>EXAMPLE</code></td>
</tr>
<tr>
<td><code>quality</code></td>
<td>Standard resolution with scan suffix</td>
<td><code>1080p</code>, <code>2160p</code>, <code>576i</code></td>
</tr>
<tr>
<td><code>resolution</code></td>
<td>Standard resolution number only</td>
<td><code>1080</code></td>
</tr>
<tr>
<td><code>video</code></td>
<td>Video codec; rename it with <a href="#codec_names"><code>codec_names</code></a></td>
<td><code>H.264</code>, <code>H.265</code></td>
</tr>
<tr>
<td><code>hdr</code></td>
<td>Dynamic-range label</td>
<td><code>HDR</code>, <code>HDR10P</code>, <code>DV</code>, <code>DV.HDR</code>, <code>DV.HDR10P</code>, <code>DV.HDRVivid</code>, <code>HDRVivid</code>, <code>HLG</code></td>
</tr>
<tr>
<td><code>hfr</code></td>
<td>High frame rate marker (frame rate &gt; 30)</td>
<td><code>HFR</code></td>
</tr>
<tr>
<td><code>3d</code></td>
<td>Stereoscopic 3D marker (MV-HEVC video)</td>
<td><code>3D</code></td>
</tr>
<tr>
<td><code>edition</code></td>
<td>Edition label from the track, if any</td>
<td><code>Directors Cut</code></td>
</tr>
<tr>
<td><code>tag</code></td>
<td>Release-group tag (from <a href="#tagging-naming-keys"><code>tag</code></a>, <a href="#tag_rules"><code>tag_rules</code></a> or <code>--tag</code>)</td>
<td><code>TAG</code></td>
</tr>
<tr>
<td><code>repack</code></td>
<td><code>REPACK</code> when the <code>--repack</code> flag is used</td>
<td><code>REPACK</code></td>
</tr>
<tr>
<td><code>lang_tag</code></td>
<td>Result of your <a href="../download/#language_tags"><code>language_tags</code></a> rules, if configured</td>
<td><code>MULTi</code></td>
</tr>
</tbody>
</table>
<p><strong>Audio</strong></p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Meaning</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>audio</code></td>
<td>Audio codec; rename it with <a href="#codec_names"><code>codec_names</code></a></td>
<td><code>DDP</code>, <code>DD</code>, <code>AAC</code>, <code>DTS-X</code></td>
</tr>
<tr>
<td><code>audio_channels</code></td>
<td>Channel layout; bed.LFE.heights when the track has height channels</td>
<td><code>5.1</code>, <code>2.0</code>, <code>5.1.4</code></td>
</tr>
<tr>
<td><code>audio_full</code></td>
<td>Codec + channels combined; a name that ends in a digit gets a separator</td>
<td><code>DDP5.1</code>, <code>DTS-X.5.1.4</code>, <code>AC4.2.0</code></td>
</tr>
<tr>
<td><code>atmos</code></td>
<td><code>Atmos</code> when an audio track in the file carries JOC or is marked Atmos, as in the <code>--list</code> row (MediaInfo shows no JOC for AC-4)</td>
<td><code>Atmos</code></td>
</tr>
<tr>
<td><code>dual</code></td>
<td><code>DUAL</code> for two audio languages (see <a href="../download/#dual_multi_mode"><code>dual_multi_mode</code></a>)</td>
<td><code>DUAL</code></td>
</tr>
<tr>
<td><code>multi</code></td>
<td><code>MULTi</code> for more than two audio languages</td>
<td><code>MULTi</code></td>
</tr>
<tr>
<td><code>dubbed</code></td>
<td><code>DUBBED</code> for a single audio language that is not the original (strict mode only)</td>
<td><code>DUBBED</code></td>
</tr>
</tbody>
</table>
<p><strong>Episode</strong> (<code>series</code> and <code>sports</code> templates)</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Meaning</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>season</code></td>
<td>Zero-padded season (<code>S%02d</code>)</td>
<td><code>S01</code></td>
</tr>
<tr>
<td><code>episode</code></td>
<td>Zero-padded episode (<code>E%02d</code>)</td>
<td><code>E05</code></td>
</tr>
<tr>
<td><code>season_episode</code></td>
<td>Combined</td>
<td><code>S01E05</code></td>
</tr>
<tr>
<td><code>episode_name</code></td>
<td>Episode title</td>
<td><code>Pilot</code></td>
</tr>
<tr>
<td><code>part</code></td>
<td>Part index of a <a href="../../../guide/output-and-naming/#split-episodes">split episode</a>, empty otherwise</td>
<td><code>2</code></td>
</tr>
<tr>
<td><code>absolute</code></td>
<td>Absolute episode number, zero-padded to 3 digits, empty when unknown</td>
<td><code>007</code></td>
</tr>
<tr>
<td><code>date</code></td>
<td>ISO air date, empty when the episode has none</td>
<td><code>2024-06-01</code></td>
</tr>
</tbody>
</table>
<p>When an episode has an air date, <code>season</code> and <code>season_episode</code> become the formatted air date,
unshackle clears <code>episode</code> and <code>year</code>, and <code>{date}</code> holds the ISO date. The separator inside
the date follows the style of the template. A <code>sports</code> template differs: <code>{date}</code> holds the
air date in the separator style of the template (<code>2026.11.01</code>), and <code>{year}</code> is empty when the
event has an air date. See <a href="../../../guide/output-and-naming/#sports-events">Sports events</a>.</p>
<p><strong>Music</strong> (<code>songs</code> and <code>albums</code> templates)</p>
<table>
<thead>
<tr>
<th>Variable</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>track_number</code></td>
<td>Zero-padded track number</td>
</tr>
<tr>
<td><code>artist</code> / <code>album_artist</code></td>
<td>Artist / album artist (falls back to artist)</td>
</tr>
<tr>
<td><code>album</code></td>
<td>Album name</td>
</tr>
<tr>
<td><code>disc</code></td>
<td>Disc number (only shown when greater than 1)</td>
</tr>
<tr>
<td><code>track_total</code> / <code>disc_total</code></td>
<td>Totals</td>
</tr>
<tr>
<td><code>release_type</code></td>
<td><code>album</code>, <code>single</code>, <code>ep</code>, or another type the service supplies</td>
</tr>
<tr>
<td><code>genre</code></td>
<td>Genre</td>
</tr>
<tr>
<td><code>explicit</code></td>
<td><code>Explicit</code> when flagged</td>
</tr>
<tr>
<td><code>isrc</code> / <code>upc</code> / <code>label</code></td>
<td>ISRC, UPC and record label</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="admonition-title"><code>quality</code> and <code>resolution</code> use the standard height</p>
<p>unshackle names a video by the nearest standard height (4320, 2160, 1440, 1080, 720, 576, 540,
480, 360 or 240) when it is within 10%. It measures the short side and the height that a 16:9
picture of the same width has, and uses the larger one. So a cropped 1920x800, a padded
1920x1088 and a 1080x1920 portrait video are all <code>1080p</code>. A short side within 16 lines of
2160, 1440 or 1080 gives that height, so an ultrawide 2560x1080 is <code>1080p</code>. A size with no
standard height near it, such as 1600x900, keeps its own height. <code>dl -q</code> and the
<code>dl --export</code> file name use the same rule.</p>
</div>
<div class="admonition warning">
<p class="admonition-title">An unknown variable stops the naming</p>
<p>unshackle warns at startup about a variable that is not in the tables above, and continues.
When it names a file, a required variable (no <code>?</code>) that the title does not have, such as a
typo like <code>{quailty}</code> or <code>{season}</code> in a <code>movies</code> template, stops the title with
<code>Missing required template variables</code>. An optional <code>{quailty?}</code> is removed.</p>
</div>
<div class="admonition warning">
<p class="admonition-title"><code>{part?}</code> is already inside <code>{season_episode}</code></p>
<p><code>part</code> holds the bare part index of a
@@ -2229,13 +2617,13 @@ examples, see <a href="../../../guide/output-and-naming/#sports-events">Sports e
<td><code>chapter_fallback_name</code></td>
<td>str</td>
<td><code>""</code></td>
<td>Fallback template for chapter names, e.g. <code>"Chapter {i:02}"</code>.</td>
<td>The name of a chapter that has no name, as a template, e.g. <code>"Chapter {i:02}"</code>. <code>{i}</code> is the chapter number, from 1; <code>{j}</code> counts only the chapters without a name. Format directives such as <code>{i:02}</code> work.</td>
</tr>
<tr>
<td><code>unicode_filenames</code></td>
<td>bool</td>
<td><code>false</code></td>
<td>Allow Unicode in filenames; when <code>false</code>, names are ASCII-sanitised.</td>
<td><code>false</code> transliterates non-ASCII characters to ASCII and removes accents. <code>true</code> keeps the native characters in file and folder names, with the vowel and tone marks of languages such as Thai, Hindi and Bengali. With each value, unshackle first normalises the name to Unicode NFC.</td>
</tr>
<tr>
<td><a href="#filename_replacements"><code>filename_replacements</code></a></td>
@@ -2251,7 +2639,7 @@ examples, see <a href="../../../guide/output-and-naming/#sports-events">Sports e
</ul>
<p>Renames the codec and HDR names in the filename. Each map key is a name that unshackle writes by
default, and its value is the name to write instead. The map applies to the <code>video</code>, <code>audio</code>,
and <code>hdr</code> <a href="../../../guide/output-and-naming/#template-variables">template variables</a>, and so
and <code>hdr</code> <a href="#template-variables">template variables</a>, and so
also to <code>audio_full</code>. A name that is not in the map stays as it is, and an empty value removes
the name. You can also set <code>codec_names</code> for one service under <code>services</code>.</p>
<div class="language-yaml highlight"><span class="filename">unshackle.yaml</span><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="nt">codec_names</span><span class="p">:</span>
@@ -2328,7 +2716,7 @@ layer <code>DV.HDRVivid</code>. Plain <code>DV</code> does <strong>not</strong>
also that HDR10 gives <code>HDR</code>, not <code>HDR10</code>, and so does a PQ video track with no HDR10
metadata. The full set of values is <code>HDR</code>, <code>HDR10P</code>, <code>DV</code>, <code>DV.HDR</code>, <code>DV.HDR10P</code>,
<code>DV.HDRVivid</code>, <code>HDRVivid</code>, and <code>HLG</code>, as listed in the
<a href="../../../guide/output-and-naming/#template-variables">variable table</a>.</p>
<a href="#template-variables">variable table</a>.</p>
</div>
<h3 id="operators">Operators<a class="headerlink" href="#operators" title="Permanent link">&para;</a></h3>
<p>A condition value can start with a comparison operator, which unshackle applies to the rest of