mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-05 07:25:08 +00:00
docs(config): make the configuration reference the one owner of every option table
This commit is contained in:
+11
-160
@@ -44,17 +44,7 @@ output_template:
|
||||
songs: "{track_number}. {title}"
|
||||
```
|
||||
|
||||
The recognized kinds are:
|
||||
|
||||
| Kind | Applies to | Default when unset |
|
||||
|---|---|---|
|
||||
| `movies` | Movies | *(required for movie downloads to be named, no built-in default)* |
|
||||
| `series` | TV episodes | *(required for episode downloads to be named)* |
|
||||
| `songs` | Music tracks | `"{track_number}. {title}"` |
|
||||
| `albums` | Album **folders** only (see below) | - |
|
||||
|
||||
!!! note
|
||||
`movies` and `series` have no hardcoded filename fallback. If you download those title types, define their templates. `songs` falls back to `"{track_number}. {title}"` when omitted.
|
||||
The kinds are `movies`, `series`, `sports`, `songs` and `albums` (folders only). The [`output_template` reference](../reference/configuration/output.md#output_template) gives what each kind applies to and what unshackle uses when you leave one out.
|
||||
|
||||
### Required vs. optional variables
|
||||
|
||||
@@ -95,53 +85,7 @@ unshackle looks at the characters you place *between* variables to decide the fi
|
||||
|
||||
## Template variables
|
||||
|
||||
Every variable below is valid in both output and folder templates. 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.
|
||||
|
||||
### Common / video
|
||||
|
||||
| Variable | Meaning | Example |
|
||||
|---|---|---|
|
||||
| `title` | Title name (movie/show/song name; `$` is rendered as `S`) | `The Show` |
|
||||
| `title_type` | Media kind of the title | `movie`, `series`, `music` |
|
||||
| `year` | Release year | `2024` |
|
||||
| `source` | Service tag / class name (empty with `--no-source`) | `EXAMPLE` |
|
||||
| `quality` | Standard resolution with scan suffix | `1080p`, `2160p`, `576i` |
|
||||
| `resolution` | Standard resolution number only | `1080` |
|
||||
| `video` | Video codec | `H.264`, `H.265` |
|
||||
| `hdr` | Dynamic-range label | `HDR`, `HDR10P`, `DV`, `DV.HDR`, `DV.HDR10P`, `DV.HDRVivid`, `HDRVivid`, `HLG` |
|
||||
| `hfr` | High frame rate marker (frame rate > 30) | `HFR` |
|
||||
| `3d` | Stereoscopic 3D marker (MV-HEVC video) | `3D` |
|
||||
| `edition` | Edition label from the track, if any | `Directors Cut` |
|
||||
| `tag` | Release-group tag (from `config.tag` or `--tag`) | `TAG` |
|
||||
| `repack` | `REPACK` when the `--repack` flag is used | `REPACK` |
|
||||
| `lang_tag` | Result of your `language_tags` rules, if configured | `MULTi` |
|
||||
|
||||
!!! note "`quality` and `resolution` use the standard height"
|
||||
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 `1080p`. A short side within 16 lines of
|
||||
2160, 1440 or 1080 gives that height, so an ultrawide 2560x1080 is `1080p`. A size with no
|
||||
standard height near it, such as 1600x900, keeps its own height. `dl -q` and the
|
||||
`dl --export` file name use the same rule.
|
||||
|
||||
!!! note "How `language_tags` rules match"
|
||||
unshackle tries the rules in order, and they compare languages with the same [matching rules](downloading.md#exact-vs-fuzzy-matching) as `-l`: a rule condition of `en` matches `en-US`, `en-GB`, and any other `en-*` form, but `es-419` matches only `es-419`. Within a single rule, **all** conditions must match (AND logic) for it to apply. The first rule that fully matches wins. If none match, unshackle removes `{lang_tag?}` from the filename cleanly.
|
||||
|
||||
### Episode-specific
|
||||
|
||||
| Variable | Meaning | Example |
|
||||
|---|---|---|
|
||||
| `season` | Zero-padded season (`S%02d`) | `S01` |
|
||||
| `episode` | Zero-padded episode (`E%02d`) | `E05` |
|
||||
| `season_episode` | Combined | `S01E05` |
|
||||
| `episode_name` | Episode title | `Pilot` |
|
||||
| `part` | Part index of a [split episode](#split-episodes), empty otherwise | `2` |
|
||||
| `absolute` | Absolute episode number, zero-padded to 3 digits, empty when unknown | `007` |
|
||||
| `date` | ISO air date, empty when the episode has none | `2024-06-01` |
|
||||
|
||||
!!! note "Daily & sports content"
|
||||
When an episode has an air date, unshackle switches to date-based naming automatically. `season` and `season_episode` become the formatted air date, unshackle clears `episode` and `year`, and `{date}` holds the ISO date. The date's internal separator (dots or spaces) follows your `series` template style.
|
||||
The [template variable reference](../reference/configuration/output.md#template-variables) lists every variable, what it holds, and the templates that can use it. Two kinds of episode get special names.
|
||||
|
||||
### Split episodes {#split-episodes}
|
||||
|
||||
@@ -167,7 +111,7 @@ The same holds for a folder template of your own: `{season}` never picks up the
|
||||
!!! note "What media servers do with the part token"
|
||||
The form above follows scene practice for genuinely split episodes. Kodi stacks the parts back into one playable episode automatically. Jellyfin lists two versions of S01E01, still correct and playable, because its stacking pattern expects the part marker at the end of the name. Plex uses a closed-source scanner, so what it does with text after the part token is not known.
|
||||
|
||||
For custom templates there is also a standalone [`{part}`](../reference/configuration/output.md#output_template) variable. You rarely want it, see the caveat on that page.
|
||||
For custom templates there is also a standalone [`{part}`](../reference/configuration/output.md#template-variables) variable. You rarely want it, see the caveat on that page.
|
||||
|
||||
### Sports events {#sports-events}
|
||||
|
||||
@@ -180,10 +124,7 @@ output_template:
|
||||
sports: "{title}.{year?}"
|
||||
```
|
||||
|
||||
A `sports` template can use every series variable, with two differences:
|
||||
|
||||
- `{date}` holds the air date in the separator style of the template (`2026.11.01`), and is empty when the event has no air date.
|
||||
- `{year}` is empty when the event has an air date, because the date holds the year.
|
||||
A `sports` template can use every series variable. `{date}` and `{year}` work differently there; see the [template variable reference](../reference/configuration/output.md#template-variables).
|
||||
|
||||
An event with a year and no air date, and an event with an air date:
|
||||
|
||||
@@ -196,35 +137,6 @@ Club.League.2026/
|
||||
|
||||
A `sports` folder template groups by `{year}`, or by the air year when the event has no year. `{season}`, `{episode}` and `{season_episode}` are not useful in a `sports` template. Use `-w S01E02` to select an event: the season and episode numbers stay on the title.
|
||||
|
||||
### Audio
|
||||
|
||||
| Variable | Meaning | Example |
|
||||
|---|---|---|
|
||||
| `audio` | Audio codec; rename it with [`codec_names`](../reference/configuration/output.md#codec_names) | `DDP`, `DD`, `AAC`, `DTS-X` |
|
||||
| `audio_channels` | Channel layout; bed.LFE.heights when the track has height channels | `5.1`, `2.0`, `5.1.4` |
|
||||
| `audio_full` | Codec + channels combined; a name that ends in a digit gets a separator | `DDP5.1`, `DTS-X.5.1.4`, `AC4.2.0` |
|
||||
| `atmos` | `Atmos` when an audio track in the file carries JOC or is marked Atmos, as in the `--list` row (MediaInfo shows no JOC for AC-4) | `Atmos` |
|
||||
| `dual` | `DUAL` for two audio languages (see [`dual_multi_mode`](../reference/configuration/download.md#dual_multi_mode)) | `DUAL` |
|
||||
| `multi` | `MULTi` for more than two audio languages | `MULTi` |
|
||||
| `dubbed` | `DUBBED` for a single audio language that is not the original (strict mode only) | `DUBBED` |
|
||||
|
||||
### Music-specific
|
||||
|
||||
| Variable | Meaning |
|
||||
|---|---|
|
||||
| `track_number` | Zero-padded track number |
|
||||
| `artist` / `album_artist` | Artist / album artist (falls back to artist) |
|
||||
| `album` | Album name |
|
||||
| `disc` | Disc number (only shown when greater than 1) |
|
||||
| `track_total` / `disc_total` | Totals |
|
||||
| `release_type` | `album`, `single`, `ep`, or another type the service supplies |
|
||||
| `genre` | Genre |
|
||||
| `explicit` | `Explicit` when flagged |
|
||||
| `isrc` / `upc` / `label` | ISRC, UPC and record label |
|
||||
|
||||
!!! warning "Unknown variables are ignored, not errors"
|
||||
If you use a variable that is not in the list above, unshackle gives a warning at startup but continues. Double-check spelling. A typo'd `{quailty}` stays in the filename literally, or unshackle drops it. unshackle does not fill it in.
|
||||
|
||||
## Folder templates
|
||||
|
||||
Folder templates sit under a special `folder` config key inside `output_template`. unshackle reads this config key separately from the filename kinds. You can give it a single string (for all title kinds) or a per-kind map.
|
||||
@@ -250,12 +162,12 @@ Folder templates sit under a special `folder` config key inside `output_template
|
||||
albums: "{artist} - {album} ({year})"
|
||||
```
|
||||
|
||||
The per-kind folder config keys are `movies`, `series`, `sports`, `songs`, and `albums`. Any other config key gives a startup warning. Folder templates permit path separators (`/` or `\`). unshackle formats each segment independently, so you can assemble nested directory structures like `Show/Season 01`. unshackle reads the separator style from the whole template, so it spaces every segment alike.
|
||||
The per-kind folder config keys are the [output kinds](../reference/configuration/output.md#output_template). Any other config key gives a startup warning. Folder templates permit path separators (`/` or `\`). unshackle formats each segment independently, so you can assemble nested directory structures like `Show/Season 01`. unshackle reads the separator style from the whole template, so it spaces every segment alike.
|
||||
|
||||
**Fallback behaviour:**
|
||||
|
||||
- A per-kind folder template wins if present. If there is none, unshackle uses the single `folder` string. If there is no `folder` string either, unshackle falls back to a built-in default.
|
||||
- Built-in defaults when no folder template is set. Movies get no folder at all unless a `movies` folder template (or a single-string `folder` template) exists. Series fall back to a folder *derived* from the `series` output template (stripping `{episode}`, `{episode_name}`, and collapsing `{season_episode}` down to `{season}`). A sports event with no `sports` folder template uses the `series` folder template, or derives its folder from the `sports` output template when there is no folder template. Music albums fall back to `{artist} - {album} ({year})`. If the song has no year, the folder name is only `{artist} - {album}`.
|
||||
- Built-in defaults when no folder template is set. Movies get no folder at all unless a `movies` folder template (or a single-string `folder` template) exists. Series fall back to a folder *derived* from the `series` output template (stripping `{episode}`, `{episode_name}`, and collapsing `{season_episode}` down to `{season}`). A sports event with no `sports` folder template uses the `series` folder template, or derives its folder from the `sports` output template when there is no folder template. Music albums fall back as the [`albums` row](../reference/configuration/output.md#output_template) gives.
|
||||
|
||||
!!! note "Movies are flat by default"
|
||||
Episodes and songs are always foldered. unshackle writes movies directly into the output directory *unless* you define a `movies` folder template (or a single-string `folder` template, which folders every kind). Set one if you want each movie in its own directory.
|
||||
@@ -488,13 +400,7 @@ muxing:
|
||||
subtitle: en
|
||||
```
|
||||
|
||||
| Key | Type | Default | Effect |
|
||||
|---|---|---|---|
|
||||
| `set_title` | bool | `true` | Write the title name into the MKV container title with `--title`. Set to `false` to omit it. |
|
||||
| `merge_video` | bool | `false` | Group video tracks that share the same resolution, range, and codec into one file so only language varies inside it. |
|
||||
| `merge_audio` | bool | `true` | Merge audio tracks of the same kind so multiple languages sit in one file. |
|
||||
| `default_language` | map | *(unset)* | Preferred language per track type (`video` / `audio` / `subtitle`). A track in the preferred language is flagged as the default track. |
|
||||
| `default_subtitle_type` | str or list | *(unset)* | The subtitle types that can take the default flag, in order: `forced`, `normal`, `sdh` (CC counts as SDH). The first subtitle track of the first type that the title has gets the flag. |
|
||||
The [`muxing` reference](../reference/configuration/download.md#muxing) gives the type, default and values of each config key.
|
||||
|
||||
When no track has the preferred language, unshackle applies sensible defaults. The video default falls back to the title language, then the original-language track, then the first track. The audio default is the original-language track. The subtitle default is a forced track in the language of the default audio track.
|
||||
|
||||
@@ -550,13 +456,7 @@ tag_group_name: true
|
||||
tag_imdb_tmdb: true
|
||||
```
|
||||
|
||||
| Key | Type | Default | Effect |
|
||||
|---|---|---|---|
|
||||
| `tag` | str | `""` | The release-group tag used for `{tag}`. |
|
||||
| `tag_group_name` | bool | `true` | Write the group name (`config.tag`) into the MKV `Group` metadata tag. |
|
||||
| `tag_imdb_tmdb` | bool | `true` | Look up and embed IMDb / TMDB / TVDB external-ID tags in the MKV metadata (uses `tmdb_api_key` / `tvdb_api_key` / `simkl_client_id` when available). |
|
||||
|
||||
unshackle writes the IDs as the Matroska `IMDB`, `TMDB`, and `TVDB2` tags. `TVDB2` values carry the
|
||||
The [tagging keys](../reference/configuration/output.md#tagging-naming-keys) give the type and default of `tag`, `tag_group_name` and `tag_imdb_tmdb`. unshackle writes the IDs as the Matroska `IMDB`, `TMDB`, and `TVDB2` tags. `TVDB2` values carry the
|
||||
entity prefix the [Matroska tagging spec](https://www.matroska.org/technical/tagging.html)
|
||||
requires: `series/73871` for a show, `movies/113` for a film.
|
||||
|
||||
@@ -583,12 +483,7 @@ By default unshackle transliterates non-ASCII characters into ASCII equivalents.
|
||||
unicode_filenames: true
|
||||
```
|
||||
|
||||
| Value | Result |
|
||||
|---|---|
|
||||
| `false` (default) | `기생충` → transliterated ASCII; accents stripped. |
|
||||
| `true` | Native characters preserved in filenames and folders, 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. A title that a service sends in composed form and in decomposed form gives the same name.
|
||||
The [`unicode_filenames` row](../reference/configuration/output.md#tagging-naming-keys) gives both values. A title that a service sends in composed form and in decomposed form gives the same name.
|
||||
|
||||
Regardless of this setting, unshackle always removes or replaces a set of filesystem-unsafe and structural characters during sanitisation. For example, `/` and `;` become ` & `, and unshackle removes characters like `\ * ! ? , ' " < > | $ # ~`. This is why you must never put path-unsafe characters directly in a template. To change other text in a name, such as `&` to `and`, use [`filename_replacements`](../reference/configuration/output.md#filename_replacements).
|
||||
|
||||
@@ -596,60 +491,16 @@ unshackle warns at startup about a template that contains `< > : " / \ | ? *`. I
|
||||
|
||||
## Directory & filename configuration
|
||||
|
||||
The `directories` config key relocates unshackle's working folders. You can move only the folders in the table below. unshackle protects the core package paths and silently ignores them if you try to override them.
|
||||
|
||||
```yaml title="unshackle.yaml"
|
||||
directories:
|
||||
downloads: "~/Media/unshackle"
|
||||
temp: "/mnt/fast/unshackle-temp"
|
||||
cache: "~/.cache/unshackle"
|
||||
cookies: "~/.config/unshackle/cookies"
|
||||
logs: "~/.config/unshackle/logs"
|
||||
```
|
||||
|
||||
| Name | Purpose |
|
||||
|---|---|
|
||||
| `downloads` | Default output directory for finished files. |
|
||||
| `temp` | Working directory for in-progress downloads, muxing, and intermediate files. |
|
||||
| `cache` | Title/HTTP cache and update-check state. |
|
||||
| `cookies` | Per-service cookie files. |
|
||||
| `logs` | Log files. |
|
||||
| `exports` | Export JSONs. |
|
||||
| `services`, `vaults`, `fonts`, `commands` | Search paths for services, key-vault backends, bundled fonts, and CLI commands. |
|
||||
| `wvds`, `prds`, `dcsl` | Widevine devices, PlayReady devices, and DCSL data. |
|
||||
|
||||
Paths can hold a `~` for expansion. unshackle protects the names `app_dirs`, `core_dir`, `namespace_dir`, `user_configs`, and `data`, so you cannot change them.
|
||||
|
||||
### Filename patterns
|
||||
|
||||
The `filenames` config key overrides the naming patterns for a handful of internal files. These are **not** your media output names. They are logs, temp files, and per-service configs.
|
||||
|
||||
```yaml title="unshackle.yaml"
|
||||
filenames:
|
||||
log: "unshackle_{name}_{time}.log"
|
||||
chapters: "Chapters_{title}_{random}.txt"
|
||||
subtitle: "Subtitle_{id}_{language}.srt"
|
||||
```
|
||||
|
||||
| Name | Default | Where |
|
||||
|---|---|---|
|
||||
| `log` | `unshackle_{name}_{time}.log` | `directories.logs` |
|
||||
| `debug_log` | `unshackle_debug_{service}_{time}.jsonl` | `directories.logs` |
|
||||
| `config` | `config.yaml` | per-service directory |
|
||||
| `root_config` | `unshackle.yaml` | main config filename |
|
||||
| `chapters` | `Chapters_{title}_{random}.txt` | `directories.temp` |
|
||||
| `subtitle` | `Subtitle_{id}_{language}.srt` | `directories.temp` |
|
||||
The `directories` config key moves unshackle's working folders, such as `downloads`, `temp` and `cache`. The `filenames` config key changes the names of unshackle's own working files, such as logs and the chapters file; it does not change the names of your media files. The [Directories reference](../reference/configuration/directories.md) lists each folder and each file name, with its default.
|
||||
|
||||
### Chapters naming {#chapters-naming}
|
||||
|
||||
When a title has chapters, unshackle writes them to an OGM chapters file (`filenames.chapters`) and passes it to the muxer. Unnamed chapters use the `chapter_fallback_name` template:
|
||||
When a title has chapters, unshackle writes them to an OGM chapters file (`filenames.chapters`) and passes it to the muxer. A chapter with no name gets the [`chapter_fallback_name`](../reference/configuration/output.md#tagging-naming-keys) template:
|
||||
|
||||
```yaml title="unshackle.yaml"
|
||||
chapter_fallback_name: "Chapter {i:02}"
|
||||
```
|
||||
|
||||
The fallback can hold two placeholders: `{i}` (chapter number, starting at 1) and `{j}` (which increments only for unnamed chapters). It permits standard format directives like `{i:02}`.
|
||||
|
||||
## Removed & migrated options
|
||||
|
||||
!!! warning "`scene_naming` was removed"
|
||||
|
||||
Reference in New Issue
Block a user