docs(config): make the configuration reference the one owner of every option table

This commit is contained in:
imSp4rky
2026-12-04 18:02:28 -07:00
parent ec6a48f8c0
commit 2f8e2aba37
16 changed files with 555 additions and 659 deletions
+18 -55
View File
@@ -58,7 +58,7 @@ format-appropriate clean-up to make a single, valid file:
negative timestamps to `00:00:00.000`, removes stray cue identifiers (like `Q0`, `Q1`)
that confuse downstream parsers, and merges multi-line cues that a service split into
separate overlapping cues. By default unshackle keeps the original styling and layout
(see [`preserve_formatting`](#subtitle-configuration)).
(see [`preserve_formatting`](../reference/configuration/download.md#subtitle)).
- **Cue markup normalisation**: unshackle removes the WebVTT-only parts of a cue
payload, so no player draws them as dialogue. See
[Cue markup](#cue-markup-and-html-entities).
@@ -202,7 +202,7 @@ CCExtractor tool on your `PATH`.
When a language has an SDH track but **no** plain (non-SDH, non-forced) track, unshackle
can make a clean non-SDH version for you by stripping the hearing-impaired cues:
sound effects, speaker labels, music notes, and similar. This is on by default and
controlled by the [`strip_sdh`](#subtitle-configuration) config key.
controlled by the [`strip_sdh`](../reference/configuration/download.md#subtitle) config key.
The check uses the same [matching rules](downloading.md#exact-vs-fuzzy-matching) as
`--s-lang`. A plain track covers an SDH track only when it is the same variant: `en` and
@@ -210,31 +210,18 @@ The check uses the same [matching rules](downloading.md#exact-vs-fuzzy-matching)
copy. When unshackle creates a stripped
copy, it keeps the original SDH track as well, so you end up with both.
The [`sdh_method`](#subtitle-configuration) config key selects the stripping engine
itself. The default (`auto`) prefers the `subby` cleaner for SRT, falls back to
SubtitleEdit when you install it, and otherwise uses the built-in `filter-subs`
approach.
Every engine removes the same three things: bracketed sound effects (`[MUSIC PLAYING]`,
`(door creaks)`), speaker labels (`MAN:`), and font tags. Every engine keeps plain
dialogue and inline `<i>` styling. They differ on music and lyric lines:
| `sdh_method` | Engine that runs | Lyric lines (`♪ ... ♪`) |
| --- | --- | --- |
| `auto` | `subby` for an SRT track. SubtitleEdit for any other format when you install it, otherwise `filter-subs`. | Kept, unless the fallback reaches `filter-subs`. |
| `subby` | `subby`, but only for a track that is already SRT. Any other format falls through to `filter-subs`. | Kept for SRT, removed otherwise. |
| `subtitleedit` | SubtitleEdit when you install it, otherwise `filter-subs`. | Kept with SubtitleEdit, removed without it. |
| `filter-subs` | `filter-subs` always. | Removed. |
The [`sdh_method`](../reference/configuration/download.md#sdh-engines) config key selects the stripping engine
itself. Every engine removes sound effects, speaker labels and font tags. The engines differ
on lyric lines and on the formats that they read.
Pick `filter-subs` when you want lyrics gone as well. Pick `subby` or install
SubtitleEdit when you want to read along with the songs.
!!! note "Why `convert_before_strip` exists"
`subby`'s SDH stripper only operates on SRT. Handed any other codec it returns
silently without stripping anything, not an error but a no-op that leaves the SDH
cues in place. This is the whole reason for [`convert_before_strip`](#subtitle-configuration):
non-SubtitleEdit engines need the subtitle converted to SRT first, or the
hearing-impaired cues stay in the file.
`subby` and `filter-subs` read only SRT. unshackle gives `subby` only a track that is
already SRT, and sends any other track to `filter-subs`. This is the reason for
[`convert_before_strip`](../reference/configuration/download.md#subtitle): `filter-subs`
needs the subtitle converted to SRT first, or the hearing-impaired cues stay in the file.
## Converting subtitle formats
@@ -273,25 +260,13 @@ order in which they are drawn.
A `sidecar_format: srt` will still lossily flatten styled subtitles, dropping
positioning, colours, and styling, and a per-download `--sub-format srt` forces the
muxed track to convert as well. To keep raw styled sidecars, set
[`sidecar_format: original`](#subtitle-configuration).
[`sidecar_format: original`](../reference/configuration/download.md#subtitle).
### How the conversion backend is chosen
Under the hood unshackle picks the highest-fidelity converter that supports the
source→target pair. Which converter runs depends on the
[`conversion_method`](#subtitle-configuration) config key (default `auto`) and the
formats involved:
| Backend | Best at | Requires |
| --- | --- | --- |
| `subtitleedit` | Highest fidelity; preserves positioning and italics | SubtitleEdit installed |
| `subby` | Native SRT output with clean-up | - |
| `pysubs2` | Best fidelity for styled SSA/ASS | - (pure Python, always available) |
| `pycaption` | Last-resort fallback; flattens styling | - |
With `conversion_method: auto`, unshackle ranks these automatically per conversion.
Setting it to a specific value pins that backend as the first choice, falling back to
others only if the pin cannot convert the pair.
source→target pair. Which converter runs depends on the formats and on the
[`conversion_method`](../reference/configuration/download.md#conversion-backends) config key.
#### What each backend preserves
@@ -368,7 +343,7 @@ every `conversion_method`:
By default unshackle muxes subtitles **into** the final `.mkv`. You can instead (or
additionally) write them as separate sidecar files next to the video, controlled by the
[`output_mode`](#subtitle-configuration) config key:
[`output_mode`](../reference/configuration/download.md#subtitle) config key:
=== "mux (default)"
@@ -410,7 +385,7 @@ Show.S01E01.1080p.WEB.en.sdh.srt
```
The pattern is `{base}.{language}[.forced][.sdh].{extension}`. The
[`sidecar_format`](#subtitle-configuration) config key sets the sidecar file format. Use
[`sidecar_format`](../reference/configuration/download.md#subtitle) config key sets the sidecar file format. Use
a format name like `srt` or `vtt`, or `original` to keep each subtitle in its downloaded
format.
@@ -424,7 +399,7 @@ unshackle dl --sub-font "Noto Sans" EXAMPLE 81234567
```
`--sub-font` sets only the font name. The rest of the look comes from
[`subtitle.ass_style`](#subtitle-configuration), a mapping of style fields. A field takes its
[`subtitle.ass_style`](../reference/configuration/download.md#subtitle), a mapping of style fields. A field takes its
[pysubs2 name](https://pysubs2.readthedocs.io/en/latest/api-reference.html#ssastyle-style-of-subtitles)
(`primarycolor`) or its ASS name (`PrimaryColour`). Give sizes and margins for a 1080-line
picture. unshackle writes a 1080-line canvas in the shape of the video, and the player scales
@@ -492,19 +467,7 @@ subtitle:
sidecar_format: srt
```
| Key | Default | Values | Purpose |
| --- | --- | --- | --- |
| `strip_sdh` | `true` | `true` / `false` | Auto-generate a stripped non-SDH copy when a language has only an SDH track. |
| `preserve_formatting` | `true` | `true` / `false` | Keep original WebVTT styling and layout during sanitization. When `false`, WebVTT is re-encoded more aggressively (merging identical cues, dropping empty ones). |
| `conversion_method` | `auto` | `auto`, `subby`, `pysubs2`, `subtitleedit`, `pycaption` | Which conversion backend to prefer. `auto` ranks them per conversion. |
| `sdh_method` | `auto` | `auto`, `subby`, `subtitleedit`, `filter-subs` | Engine used to strip hearing-impaired cues. |
| `convert_before_strip` | `true` | `true` / `false` | Convert a subtitle to SRT before stripping SDH (for non-SubtitleEdit engines). |
| `output_mode` | `mux` | `mux`, `sidecar`, `both` | Whether subtitles are embedded, written as sidecars, or both. |
| `sidecar_format` | `srt` | a format name (e.g. `srt`, `vtt`) or `original` | Format used for sidecar files. |
| `group_by` | `type` | `type`, `language` | Whether all tracks of one type stay together, or each language stays next to its own variants. |
| `language_priority` | *(unset)* | a list of languages | Languages to sort to the top. The rest keep the default order. Nothing is removed. |
| `dedupe_codecs` | *(unset)* | a list of codecs, e.g. `[VTT, STPP, WVTT]` | Keep one copy of a subtitle that the service sends in several codecs: the earliest listed codec wins. |
| `ass_style` | *(unset)* | a mapping of pysubs2 style fields | The look of subtitles converted to ASS; makes ASS the default output format. See [custom font and style](#custom-font-and-style). |
The [`subtitle` reference](../reference/configuration/download.md#subtitle) lists every config key of the block, with its type, default and values.
### Which settings to change
@@ -530,8 +493,8 @@ Two keys read as if they control markup, and do not:
markup in the file: [cue markup normalisation](#cue-markup-and-html-entities) runs
either way.
- **`convert_before_strip`** applies to SDH stripping, not to your output format. It
converts the working copy to SRT so a non-SubtitleEdit engine can read it. Turning it
off makes `subby` and `filter-subs` no-ops on anything that is not already SRT.
converts the working copy to SRT so `filter-subs` can read it. Turning it
off makes `filter-subs` a no-op on anything that is not already SRT.
!!! tip "SubtitleEdit is optional but recommended"
Several high-fidelity paths (the best-quality conversions and the SubtitleEdit SDH