docs(cli): make cli-reference the one description of each dl flag and downloading.md the task guide

This commit is contained in:
imSp4rky
2026-12-04 18:23:52 -07:00
parent 2f8e2aba37
commit b96c2a725e
12 changed files with 271 additions and 445 deletions
+82 -289
View File
@@ -1,17 +1,14 @@
# Downloading
`unshackle dl` is the main download command: it fetches a title's manifest from a
streaming service, selects exactly the tracks you asked for, acquires and applies
decryption keys, and muxes everything into a finished Matroska file. The flags below
cover quality and codec selection, language and subtitle handling, episode ranges, and
the download flow itself.
streaming service, selects exactly the tracks you asked for, gets and applies the
content keys, and muxes everything into a finished Matroska file. This page shows how
to do common download tasks and how the flags work together.
!!! note "Where the full flag list lives"
This page covers the flags you will use most and explains how they interact. It is
not an exhaustive enumeration. For the complete, always-current list of every option
and its exact wording, use `unshackle dl --help`. Every flag shown here can also be
given a default in your configuration file. See
[Configuration file](../getting-started/configuration-file.md).
!!! note "Where each flag is described"
The [CLI reference](cli-reference.md#dl) describes each `dl` flag and its default, and
`unshackle dl --help` gives a short description of each. To give a flag a default in your
configuration file, use the [`dl`](../reference/configuration/download.md#dl) block.
## Command shape
@@ -59,14 +56,16 @@ with `--skip-dl`.
5. **Get tracks**: parse the manifest into video, audio, subtitle, and chapter tracks.
6. **Select tracks**: narrow each type down using your quality, codec, range, language,
and bitrate flags.
7. **Download**: pull segments for the selected tracks (concurrently per `--downloads`).
8. **License & decrypt**: get the content keys (vault → CDM), decrypt each track.
7. **Licence**: get the content keys of each selected track, in the
[key order](drm-and-cdm.md#keys-vaults-and-caching).
8. **Download & decrypt**: pull the segments of the selected tracks (concurrently per
`--downloads`), merge them, and decrypt each track.
9. **Post-process**: extract closed captions, convert subtitles, repack, mux with
`mkvmerge`, and move the finished file to your downloads directory.
`--list` prints the tracks a title exposes and stops before selection. `--list-titles`
prints every title the service returned and stops before `--wanted`/`--latest-episode`/`--latest-episodes`
filtering. `--skip-dl` runs the license step but skips the actual segment download.
filtering. `--skip-dl` runs the licence step but skips the segment download.
## Choosing quality
@@ -96,12 +95,10 @@ unshackle dl -q 2160,1080,720 EXAMPLE 81234567
### Best-available and worst
By default a missing requested resolution is an error. Two flags change that:
| Flag | Behaviour |
| --- | --- |
| `--best-available` (`--warn-only`) | If the requested resolution(s) are not present, continue with the best that *is* available instead of failing. Also softens missing video and audio languages and hybrid fallbacks, and with `--all-drm` a DRM system that does not license. |
| `--worst` | Pick the lowest-bitrate video at each requested resolution. With no requested resolution, pick the lowest-bitrate video at the lowest resolution. |
By default a missing requested resolution is an error.
[`--best-available` and `--worst`](cli-reference.md#quality-codec-bitrate-range) change that:
the first continues with the best resolution that is available, and the second picks the
lowest-bitrate video.
A `quality` in the config counts as a requested resolution. When `--best-available` finds none of the
requested resolutions, `--worst` also picks from the lowest resolution. In hybrid mode, that is the
@@ -115,24 +112,8 @@ unshackle dl -q 2160 --best-available EXAMPLE 0ABC123
### Codec
`-v` / `--vcodec` selects one or more video codecs. The default is any codec. It accepts
either enum **names** or their **values**, comma-separated.
| Name | Value |
| --- | --- |
| `AVC` | `H.264` |
| `HEVC` | `H.265` |
| `VVC` | `H.266` |
| `VC1` | `VC-1` |
| `VP8` | `VP8` |
| `VP9` | `VP9` |
| `AV1` | `AV1` |
| `LCEVC` | `LCEVC` |
`H264`, `H265` and `H266` are aliases of `AVC`, `HEVC` and `VVC`.
An LCEVC (MPEG-5 Part 2) track only adds detail on top of its base video track and cannot play
alone, so unshackle selects it only when you ask for it with `-v LCEVC`.
[`-v` / `--vcodec`](cli-reference.md#quality-codec-bitrate-range) selects one or more video codecs,
comma-separated, by name (`HEVC`) or by value (`H.265`). The default is any codec.
```shell title="Either spelling works"
unshackle dl -v HEVC EXAMPLE 81234567
@@ -142,17 +123,9 @@ unshackle dl -v hevc,avc EXAMPLE 81234567
### Colour range
`-r` / `--range` selects one or more colour ranges. The default is `SDR`.
| Range | Meaning |
| --- | --- |
| `SDR` | Standard dynamic range (default) |
| `HLG` | Hybrid Log-Gamma |
| `HDR10` | HDR10 |
| `HDR10P` | HDR10+ (`-r HDR10+` also works) |
| `VIVID` | HDR Vivid (`-r "HDR Vivid"` also works) |
| `DV` | Dolby Vision |
| `HYBRID` | Fetch both an HDR10/HDR10+/HDR Vivid base and a DV track, then merge them |
[`-r` / `--range`](cli-reference.md#quality-codec-bitrate-range) selects one or more colour ranges.
The default is `SDR`. `HYBRID` fetches both an HDR10/HDR10+/HDR Vivid base and a DV track,
then merges them.
```shell title="Grab HDR10 and Dolby Vision in one run"
unshackle dl -q 2160 -r HDR10,DV EXAMPLE '...'
@@ -273,18 +246,9 @@ measured for each pixel.
By default unshackle keeps the highest-bitrate rendition for each selected
resolution/codec/range/language combination. One requested video language is one
language here, also when it matches more than one regional tag (`en` can match
`en-AU` and `en-GB`). You can constrain this.
| Flag | Purpose |
| --- | --- |
| `-vb` / `--vbitrate` | Exact video bitrate in kbps. |
| `-ab` / `--abitrate` | Exact audio bitrate in kbps. |
| `-vb-range` / `--vbitrate-range` | Video bitrate range in kbps, e.g. `6000-7000`; picks the highest within it. |
| `-ab-range` / `--abitrate-range` | Audio bitrate range in kbps, e.g. `128-256`. |
!!! warning "Exact vs range are mutually exclusive"
You cannot combine `--vbitrate` with `--vbitrate-range`, and likewise for the audio
pair. Pick one form.
`en-AU` and `en-GB`). To pick a different bitrate, give an exact bitrate (`-vb`, `-ab`)
or a bitrate range (`-vb-range`, `-ab-range`); the
[CLI reference](cli-reference.md#quality-codec-bitrate-range) describes each.
### Real bitrate probing
@@ -292,12 +256,10 @@ Manifest-declared bitrates are sometimes rounded or wrong. Services often advert
**peak** or **nominal** bandwidth that is far from the track's real average. This matters
because a track's bitrate drives the track listing, the sort order, *and* the
`--vbitrate`/`--vbitrate-range` selection above. A bogus declared value therefore makes
unshackle pick the wrong track. These flags probe the actual media size to compute a true
bitrate for the top renditions, overriding the manifest value:
- `-rvb` / `--real-video-bitrate`: probe real video bitrates (per codec/range).
- `-rab` / `--real-audio-bitrate`: probe real audio bitrates (per codec/channels/
language). Slower than the video variant because there are more renditions to probe.
unshackle pick the wrong track.
[`-rvb` and `-rab`](cli-reference.md#quality-codec-bitrate-range) probe the media size to calculate
the real bitrate of the top video and audio renditions, and override the manifest value. The
audio probe is slower, because there are more audio renditions to probe.
!!! note "Reading the probed numbers"
unshackle measures a single-file track (DASH `SegmentBase`/`BaseURL`) **exactly**. A
@@ -321,27 +283,9 @@ bitrate for the top renditions, overriding the manifest value:
### Codec
`-a` / `--acodec` selects one or more audio codecs (comma-separated). The default is any.
| Name | Value | Codec |
| --- | --- | --- |
| `AAC` | `AAC` | Advanced Audio Coding |
| `AC3` | `DD` | Dolby Digital |
| `EC3` | `DD+` | Dolby Digital Plus |
| `AC4` | `AC-4` | Dolby AC-4 |
| `OPUS` | `OPUS` | Opus |
| `OGG` | `VORB` | Vorbis |
| `DTS` | `DTS` | DTS |
| `DTSX` | `DTS-X` | DTS:X Profile 2 (DTS-UHD) |
| `DTSHD` | `DTS-HD` | DTS-HD High Resolution, Master Audio and Express |
| `MPEGH` | `MPEG-H` | MPEG-H 3D Audio |
| `AV3A` | `Audio Vivid` | Audio Vivid (AVS3-P3) |
| `ALAC` | `ALAC` | Apple Lossless |
| `FLAC` | `FLAC` | FLAC |
| `MP3` | `MP3` | MPEG-1 Audio Layer III |
unshackle accepts names, values, and a few aliases: `eac3` and `ddp` both give `EC3`,
and `vorbis` gives `OGG`.
[`-a` / `--acodec`](cli-reference.md#quality-codec-bitrate-range) selects one or more audio codecs,
comma-separated, by name, value or alias from the [audio codec values](cli-reference.md#audio-codec-values).
The default is any.
```shell title="Prefer Dolby Digital Plus, fall back to AAC"
unshackle dl -a EC3,AAC EXAMPLE 81234567
@@ -349,10 +293,8 @@ unshackle dl -a EC3,AAC EXAMPLE 81234567
### Channels and Atmos
- `-c` / `--channels`: desired channel layout, for example `5.1` or `2.0`. Matching is by
ceiling, so `5.1` implicitly matches a `6.0`-reported layout. An immersive layout such as
`5.1.4` matches on its total number of channels, so `-c 10` selects it.
- `-naa` / `--noatmos`: exclude Atmos audio tracks from selection.
[`-c` / `--channels` and `-naa` / `--noatmos`](cli-reference.md#quality-codec-bitrate-range) select a
channel layout, such as `5.1` or `2.0`, and drop the Atmos tracks.
A track is Atmos when its manifest says so: a DD+ JOC descriptor, an HLS `CHANNELS` value with
`JOC` or `ATMOS` (`16/JOC`, `2/IMSA,ATMOS`), or the Smooth Streaming `HasAtmos` attribute. A DASH
@@ -388,7 +330,7 @@ unshackle dl -a AAC -ab 320 EXAMPLE 81234567
### Video and audio language
`-l` / `--lang` sets the wanted language(s) for **both video and audio**. The default is
[`-l` / `--lang`](cli-reference.md#language-subtitles) sets the wanted language(s) for **both video and audio**. The default is
`orig`, the title's original language.
```shell title="Original language plus English"
@@ -502,7 +444,7 @@ See the [exclusion rules](#excluding-languages) for `--exact-lang`.
### Selecting subtitle languages
`-sl` / `--s-lang` sets the wanted subtitle language(s). The default is `all`, so
[`-sl` / `--s-lang`](cli-reference.md#language-subtitles) sets the wanted subtitle language(s). The default is `all`, so
unshackle downloads every available subtitle language.
```shell title="Only English and Spanish subtitles"
@@ -515,7 +457,7 @@ except Spanish, forced Spanish subtitles included.
### Requiring subtitles
`--require-subs` takes a list of languages that **must** exist. If any is missing, the
[`--require-subs`](cli-reference.md#language-subtitles) takes a list of languages that **must** exist. If any is missing, the
title fails, even under `--best-available` / `--warn-only`. Use it when a download is only
worth keeping if a specific subtitle track is present.
@@ -553,7 +495,7 @@ The check runs against the full track list, before any language selection or exc
video track counts. `--no-audio` and `--no-video` drop the matching requirement.
A failed title stops the whole run. To skip that title and come back for it later, add
`--skip-missing`, or set `skip_missing: true` under `dl:` in `unshackle.yaml`. It also skips a
`--skip-missing`, or set `skip_missing` in the [`dl`](../reference/configuration/download.md#dl) block. It also skips a
title that has no track for a filter such as `-q`, `-v`, `-r`, `-a` or a language you request.
A run with one title, or a run that skips every title, still fails. A REST API job lists each
skipped title and the reason in `skipped_titles`.
@@ -565,26 +507,13 @@ unshackle dl -al ko,en --require-audio ko --skip-missing -w S06 EXAMPLE 0ABC123
### Forced subtitles and output format
- `-fs` / `--forced-subs`: include forced subtitle tracks (signs/foreign dialogue).
Without this flag, unshackle drops forced subtitle tracks from the selection.
- `-fsl` / `--forced-s-lang`: keep forced subtitles only in these languages (implies
`-fs`). Works independently of `--s-lang`, so `-sl all -fsl en` grabs every full
subtitle but only the English forced track. It accepts exclusions too: `-fsl all,-es`
keeps every forced subtitle except the Spanish one, and `-fsl -es` means the same.
- `-fso` / `--forced-subs-only`: keep only the forced subtitle tracks and drop every
other subtitle (implies `-fs`). `--s-lang` and `-fsl` still select the languages.
- `--sub-format`: set the output subtitle format, converting only when necessary.
Accepts codec names/values and common aliases (`srt`, `vtt`, `ass`, `ssa`, `ttml`,
and the other codec aliases), or the literal `original` to keep the source format.
Forced subtitles carry signs and foreign dialogue. unshackle drops them unless you add
[`-fs`, `-fsl` or `-fso`](cli-reference.md#language-subtitles). `-fsl` takes exclusions too:
`-fsl all,-es` keeps every forced subtitle except the Spanish one. With `-fso`, `--s-lang`
and `-fsl` still select the languages.
| Value | Format |
| --- | --- |
| `SRT` / `srt` | SubRip |
| `VTT` / `vtt` | WebVTT |
| `ASS` / `ass` | Advanced SubStation Alpha |
| `SSA` / `ssa` | SubStation Alpha |
| `TTML` / `ttml` | Timed Text Markup |
| `original` | Keep the source format, no conversion |
[`--sub-format`](cli-reference.md#language-subtitles) sets the subtitle format of the output, or
`original` keeps the source format.
```shell title="Convert subtitles to SRT"
unshackle dl --sub-format srt EXAMPLE 81234567
@@ -756,15 +685,8 @@ when you want a part on its own.
### Other selection flags
| Flag | Behaviour |
| --- | --- |
| `--select-titles` | Interactively pick episodes of a series, or films when a title has more than one. **Cannot combine with `-w`.** |
| `--latest-episode` | Download only the single most recent episode. |
| `--latest-episodes N` | Download only the N most recent episodes. The newest episodes can come from more than one season. A [split episode](#split-episodes) counts as one episode, and all its parts download. |
| `--max-downloads N` | Stop after N titles have downloaded. A skipped title, or a title already in the completion archive, does not count. With `--skip-dl` or `--no-mux`, a title counts when its run completes. Each part of a [split episode](#split-episodes) counts as one title. unshackle does not open the titles after the limit. |
| `--list-titles` | List every title the service returned, then stop. `-w`, `--latest-episode` and `--latest-episodes` are not applied to this listing. |
When `--latest-episode` or `--latest-episodes` is set, `-w` has no effect.
[`--select-titles`, `--latest-episode`, `--latest-episodes` and `--max-downloads`](cli-reference.md#title-episode-selection)
also select the episodes to download.
```shell title="Grab just the newest episode"
unshackle dl --latest-episode EXAMPLE 81234567
@@ -788,31 +710,9 @@ A season that the limit stops before its last episode gets no `season` post-scri
## Including and excluding track types
You can restrict a download to certain track categories, either positively (only these)
or negatively (everything but these).
**Only these types** (`*-only` flags):
- `-V` / `--video-only`
- `-A` / `--audio-only`
- `-S` / `--subs-only`
- `-C` / `--chapters-only`
**Skip these types** (`no-*` flags):
- `-nv` / `--no-video`
- `-na` / `--no-audio`
- `-ns` / `--no-subs`
- `-nc` / `--no-chapters`
- `-nt` / `--no-attachments` (cover art, subtitle fonts, and files the service attaches)
Additional track-type flags:
- `-ad` / `--audio-description`: include descriptive (audio-description) tracks, which
unshackle drops by default.
- `-ado` / `--audio-description-only`: keep only the descriptive tracks and drop the
standard audio. It does not need `-ad`. Add `-A` to download no video or subtitles.
- `--skip-subtitle-errors`: if a subtitle fails to download, skip it and continue rather
than aborting the whole title. Video and audio failures remain fatal.
or negatively (everything but these). The [CLI reference](cli-reference.md#track-type-inclusion-exclusion)
gives the `*-only` and `no-*` flags, `-ad` and `-ado` for descriptive audio, and
`--skip-subtitle-errors`.
!!! note "The `-only` kind flags"
`-ado` and `-fso` each keep one kind of track inside its track type. They do not drop
@@ -848,14 +748,12 @@ unshackle dl -nc EXAMPLE 81234567
## Listing and dry runs
Before committing to a long download, inspect what unshackle *would* do:
| Flag | Effect |
| --- | --- |
| `--list` | List the tracks the service exposes for each title, then stop. No selection, no download. |
| `--list-titles` | List every title the service returned, then stop. `-w`, `--latest-episode` and `--latest-episodes` are not applied to this listing. |
| `--skip-dl` | Skip downloading but still acquire the decryption keys. |
| `--all-drm` | License each track with both Widevine and PlayReady. See [Widevine and PlayReady on the same title](drm-and-cdm.md#widevine-and-playready-on-the-same-title). |
Before a long download, check what unshackle would do with
[`--list`](cli-reference.md#concurrency-caching-listing),
[`--list-titles`](cli-reference.md#title-episode-selection) or
[`--skip-dl`](cli-reference.md#drm-keys-decryption). To license
each track with both Widevine and PlayReady, see
[Widevine and PlayReady on the same title](drm-and-cdm.md#widevine-and-playready-on-the-same-title).
```shell title="See the track selection without downloading"
unshackle dl -q 1080 -v H.265 -r HDR10 --list EXAMPLE 81234567
@@ -865,10 +763,8 @@ unshackle dl -q 1080 -v H.265 -r HDR10 --list EXAMPLE 81234567
### Output location and folders
- `-o` / `--output`: override the output directory for this run (otherwise unshackle
uses the configured downloads directory).
- `--no-folder`: do not make a per-show folder for TV downloads.
- `--no-source`: remove the service source tag from the filename and path.
[`-o` / `--output`](cli-reference.md#output-muxing-files) sends one run to another directory, and
`--no-folder` and `--no-source` change the folder and the file name.
```shell title="Send this download somewhere specific"
unshackle dl -o ~/Videos/incoming EXAMPLE 81234567
@@ -877,15 +773,8 @@ unshackle dl -o ~/Videos/incoming EXAMPLE 81234567
### Muxing behaviour
By default, `mkvmerge` muxes the tracks of a movie or an episode into a single Matroska
(`.mkv`) file. These flags change how unshackle assembles the output:
| Flag | Behaviour | Default source |
| --- | --- | --- |
| `--no-mux` | Do not mux; keep the individual track files. | - |
| `--sample` | Download a short sample: 60 seconds from 2 minutes in, or `--sample START-END` for a window in seconds. | - |
| `--include-sample` | Download the full title, then also cut a 60 second sample from each muxed file into a `Sample` folder. | - |
| `--split-audio` | Write a separate output file per audio codec instead of merging all audio. | config `muxing.merge_audio` (on) |
| `--merge-video` | Mux video tracks that share a height, range, and codec into one file, so only language varies inside a file. | config `muxing.merge_video` (off) |
(`.mkv`) file. [`--no-mux`, `--sample`, `--include-sample`, `--split-audio` and
`--merge-video`](cli-reference.md#output-muxing-files) change how unshackle assembles the output.
!!! note "`--sample` needs a segmented track"
`--sample` downloads only the segments that hold the window, and `mkvmerge` cuts the output
@@ -907,7 +796,7 @@ By default, `mkvmerge` muxes the tracks of a movie or an episode into a single M
### After the download
`--postscript "<command>"` runs your own command once per output file, with unshackle's
[`--postscript "<command>"`](cli-reference.md#output-muxing-files) runs your own command once per output file, with unshackle's
metadata substituted into `{variable}` placeholders. It is repeatable, and it replaces the
`post_scripts` config for that run. No `success` post-script operates under `--no-mux`, because
that run writes no muxed output; a song is the exception, because `--no-mux` does not apply to it.
@@ -930,8 +819,7 @@ post-scripts and for the full variable list, see
### Naming tags
- `--tag`: set the release group tag (overrides the configured tag).
- `--repack`: add a `REPACK` tag to the output filename.
[`--tag` and `--repack`](cli-reference.md#output-muxing-files) change the tags in the file name.
```shell title="Custom group tag and a REPACK label"
unshackle dl --tag MYGRP --repack EXAMPLE 81234567
@@ -939,7 +827,7 @@ unshackle dl --tag MYGRP --repack EXAMPLE 81234567
## Proxies
`--proxy` accepts a full proxy URI, a country or location code (resolved through your
[`--proxy`](cli-reference.md#network-proxy) accepts a full proxy URI, a country or location code (resolved through your
configured proxy providers), or a `provider:region` form. See
[Proxies & VPN](proxies-and-vpn.md#how-proxy-resolution-works) for the exact grammar.
@@ -950,28 +838,14 @@ unshackle dl --proxy controld:yul EXAMPLE 81234567
unshackle dl --proxy 'http://user:pass@host:8080' EXAMPLE 81234567
```
Three related flags:
- `--no-proxy`: force-disable all proxy use for this run.
- `--no-proxy-download`: bypass the proxy for **all downloads**. The manifest,
license, and authentication requests still go through the proxy. This is useful when you
need the proxy only to satisfy geo-checks, not to move the bulk of the data.
- `--proxy-download`: use a different proxy for **all downloads**. The manifest,
license, and authentication requests still go through `--proxy`. Takes the same forms
as `--proxy`.
[`--no-proxy`, `--no-proxy-download` and `--proxy-download`](cli-reference.md#network-proxy) change
which requests use the proxy. Use `--no-proxy-download` when you need the proxy only to pass
the geo-check of the service, not to move the bulk of the data.
## Performance and caching
| Flag | Purpose |
| --- | --- |
| `--workers N` | Threads used per track for segment downloads. Default depends on the downloader. |
| `--adaptive-workers` | Opt-in: start the per-track worker count at `--workers`, reduce it when the CDN returns errors, then raise it again while the extra workers add measured throughput. The count never goes above `--workers`. Off by default (fixed worker count). |
| `--download-processes N` | Opt-in: split a large segment batch across `N` download processes, each with its own worker pool. A single process tops out around 1.3 Gb/s (Python interpreter limit); `2` reaches 2.5GbE line rate on fast CDNs. Only engages for batches of 24+ segments. Ignored while `--speed-limit` (or serve's `global_speed_limit`) is set: the cap is a per-job budget, which extra processes cannot share, so the download stays in a single process. Also ignored when the service HTTP session carries state a child process cannot rebuild, such as a custom TLS adapter. The download stays in a single process instead of running with the wrong settings. Default `1`. |
| `--continue-downloads` | Opt-in: keep completed segment files when a download fails so the next run resumes instead of restarting from zero. One-off enable of the [`continue_downloads`](../reference/configuration/download.md#continue_downloads) config option, which documents what can and cannot resume. |
| `--downloads N` | Number of tracks downloaded concurrently. Default `1`. |
| `--slow [MIN-MAX]` | Add a delay between titles to look more like a real device. `--slow` alone means 60-120s; `--slow 20-40` sets a custom range. Minimum 20s. |
| `--no-cache` | Bypass the title cache for this download. |
| `--reset-cache` | Clear the title cache before fetching. |
The [concurrency and caching flags](cli-reference.md#concurrency-caching-listing) control the parallel
downloads, the speed limit, the delay between titles and the title cache.
```shell title="Two tracks at a time, eight threads each"
unshackle dl --downloads 2 --workers 8 EXAMPLE 81234567
@@ -983,22 +857,19 @@ unshackle dl -w S01 --slow 30-60 EXAMPLE 81234567
## Keys, vaults, and export
By default, unshackle checks your **key vaults** first and only asks a **CDM** to license
a content key when the vault misses. You can force one side or the other:
- `--cdm-only`: only use the CDM (skip vaults). Over `--remote`, your own CDM licenses each track, and the run uses neither the server CDM nor the server vault. It needs a local CDM, and a remote session on the server's device fails.
- `--cdm <name>`: use the named CDM device for this run, ignoring the `cdm` config mapping (including its quality and Widevine/PlayReady sub-entries). Over `--remote`, that device licenses the remote session, not the server CDM.
- `--vaults-only`: only use key vaults and never license through the CDM. A missing
content key fails.
By default, unshackle checks your **key vaults** and only asks a **CDM** for a licence
when no vault has the content key; [Keys, vaults, and caching](drm-and-cdm.md#keys-vaults-and-caching)
gives the full order. [`--cdm-only` and `--vaults-only`](cli-reference.md#drm-keys-decryption) force
one side or the other, and `--cdm` selects the CDM device for one run.
```shell title="Fetch keys only, no download"
unshackle dl --skip-dl EXAMPLE 81234567
```
`--export` writes a `mediaexport` JSON file into the configured exports directory. It holds
the manifest, the DRM init data, the content keys, the KIDs of each track and the title
metadata for each title. For a DASH or ISM title, it also holds the manifest as the service
left it, with the ad periods that the service skips. `unshackle import` reads it to reconstruct
[`--export`](cli-reference.md#drm-keys-decryption) writes an export into the configured exports
directory. It holds the manifest, the DRM init data, the content keys, the KIDs of each track
and the title metadata for each title. For a DASH or ISM title, it also holds the manifest
snapshot: the manifest as the service left it, with the filtered periods that the download skips. `unshackle import` reads it to reconstruct
a download later, and gives each track only the content keys for its KIDs. The import uses the
saved manifest, so it skips the same periods and does not fetch the manifest again. The importer also reads the
older unshackle `version: 2` files and unidl's own export files.
@@ -1085,11 +956,11 @@ The [mediaexport](https://github.com/unshackle-dl/mediaexport) package specifies
title language, the video track takes the language of the default audio track. When
the master playlist gives no audio language either, the import stops with a message.
!!! note "Ad periods a service skipped stay skipped"
!!! note "Filtered periods stay filtered"
Some services skip DASH periods, such as ads, by a rule of their own. The export also
records the periods the service kept as `content_periods` on each manifest. An import that
must fetch the manifest again, because the file has no saved manifest or another tool wrote
it, downloads only those periods, also when the new manifest gives an ad period a new ID.
it, downloads only those periods, also when the new manifest gives a filtered period a new ID.
When the new manifest has none of the recorded periods, the import logs a warning and keeps
every period.
@@ -1103,15 +974,9 @@ of `--tmdb`, `--imdb` and `--tvdb`, and unshackle works the rest out from it. To
lookups but keep the IDs you give, set
[`disable_metadata`](../reference/configuration/misc.md#external-api-keys) in your config.
| Flag | Example | Purpose |
| --- | --- | --- |
| `--tmdb` | `--tmdb 27205` | Use this TMDB ID instead of an automatic search. Needs `tmdb_api_key`. |
| `--imdb` | `--imdb tt1375666` | Use this IMDb ID instead of an automatic search. Needs no API key. |
| `--tvdb` | `--tvdb 73871` | Use this TVDB ID instead of looking the series up. Needs `tvdb_api_key`. |
| `--anilist` | `--anilist 21` | Use this AniList ID instead of an automatic search. `mal:12345` is also accepted. Needs no API key. |
| `--enrich` | - | Overwrite the show title, year and original language with the external source's. **Requires** one of `--tmdb`, `--imdb`, `--tvdb`, or `--anilist`. |
| `--tvdb-order` | `--tvdb-order dvd` | Renumber episodes to a TVDB season order. Needs `tvdb_api_key`. |
| `-ce` / `--continuous-episodes` | - | Number each season on from the season before it, so season two starts at `S02E05` after four episodes. |
The [CLI reference](cli-reference.md#metadata-tagging) describes `--tmdb`, `--imdb`, `--tvdb`,
`--anilist`, `--enrich`, `--tvdb-order` and `--continuous-episodes`, and the rules for
combining the ID flags.
```shell title="Force the right IMDb match, and keep the service's own naming"
unshackle dl --imdb tt1375666 EXAMPLE 81234567
@@ -1166,13 +1031,6 @@ Each ID goes to the providers that read that kind of ID, in
Pair it with `--tmdb`, `--imdb` or `--tvdb` when the map has no entry for the title, or
a wrong one. An ID that you give always wins over the map.
Give **one** of `--tmdb`, `--imdb` and `--tvdb`. You cannot combine them, because one ID
does the job on its own: unshackle finds the other two from it and writes all three to the
tags.
Passing two is an error rather than a silent choice between them. `--anilist` is the exception
and still pairs with one of the three, which is how you set the western ID of an anime title
yourself.
!!! note "The AniList ID map"
An AniList match, from a search or from `--anilist`, has no TMDB, IMDb or TVDB ID. unshackle
then looks the AniList ID up in the anime-lists ID map. It downloads the map (about 7 MB) the
@@ -1190,12 +1048,6 @@ yourself.
numbering, and when the two give different entries, it writes no AniList tag. A TMDB movie ID takes only the AniList entry of that movie.
An AniList ID that you give with `--anilist` always wins over the map.
The ID you give must have a metadata provider that can find it, so unshackle makes sure of
that before it downloads anything. `--tmdb` without `tmdb_api_key`, or an ID whose metadata
providers your `metadata_providers` list leaves out, fails immediately with a message naming
what to set. `--imdb` needs no API key, because the `imdb` metadata provider is keyless
and in the default order.
With `--enrich`, the title, year and original language are all replaced with the external
source's values, whether or not the service already filled them in. A field the source does
not answer with is left alone, and unshackle logs which fields those were, so a metadata provider
@@ -1228,8 +1080,8 @@ order the service used, then renumbers the episodes into the order you asked for
unshackle dl --tvdb-order dvd EXAMPLE 81234567
```
Available orders are `official` (aired), `dvd`, `absolute`, `alternate`, and `regional`. Set
`tvdb_order` in your config to apply one by default.
Set [`tvdb_order`](../reference/configuration/misc.md#external-api-keys) in your config to apply
an order by default.
!!! warning "Orders that do not cover the whole series"
An order can leave out episodes the service carries. TVDB's `dvd` order does not
@@ -1240,7 +1092,7 @@ Available orders are `official` (aired), `dvd`, `absolute`, `alternate`, and `re
### Continuous episode numbers
Some anime release groups number each season on from the season before it. With
`--continuous-episodes`, a season two that follows a four-episode season one starts at
[`--continuous-episodes`](cli-reference.md#metadata-tagging), a season two that follows a four-episode season one starts at
`S02E05`:
```shell title="Number season two on from season one"
@@ -1253,62 +1105,3 @@ Season 0 and episode 0 keep their numbers, and a season that already starts past
season before it is not changed. The renumbering runs before `--wanted`, so select episodes
by their new numbers, for example `-w S02E05`. A whole-season selection such as `-w S05`
matches episodes up to E999 only.
## Configuration defaults
You can set every flag on this page as a default in your configuration file so you do not
have to type it each time, and you can scope defaults per service. See
[Configuration file](../getting-started/configuration-file.md) for the `dl:` block and
per-service overrides.
!!! tip "Explicit flags always win"
A value you pass on the command line (or through an environment variable) always takes
precedence over both the global `dl:` defaults and any per-service `dl:` overrides.
Config only fills in options you did not set explicitly.
## Quick reference
A condensed lookup of the most-used options. Use `unshackle dl --help` for the complete,
authoritative list.
| Flag | Short | Meaning |
| --- | --- | --- |
| `--quality` | `-q` | Target resolution(s), e.g. `1080,720`. |
| `--vcodec` | `-v` | Video codec(s). |
| `--acodec` | `-a` | Audio codec(s). |
| `--range` | `-r` | Colour range(s). Default `SDR`. |
| `--channels` | `-c` | Audio channel layout. |
| `--noatmos` | `-naa` | Exclude Atmos audio. |
| `--lang` | `-l` | Video + audio language(s); default `orig`. `-` excludes, e.g. `all,-es`. |
| `--a-lang` | `-al` | Audio-only language override. `-` excludes. |
| `--v-lang` | `-vl` | Video-only language override. `-` excludes. |
| `--s-lang` | `-sl` | Subtitle language(s); default `all`. `-` excludes, e.g. `all,-es`. |
| `--forced-subs` | `-fs` | Include forced subtitles. |
| `--forced-s-lang` | `-fsl` | Forced subtitle language(s); implies `-fs`. `-` excludes. |
| `--sub-format` | | Output subtitle format. |
| `--sub-font` | | Font for subtitles converted to ASS; implies `--sub-format ASS`. |
| `--wanted` | `-w` | Episode/season range, an air date, or a number of the track list for a music release (`1-5`, `2x3`). |
| `--daily` | | Fill missing air dates from TVDB during `--enrich`. |
| `--select-titles` | | Interactively pick episodes or films. |
| `--latest-episode` | | Only the newest episode. |
| `--latest-episodes N` | | Only the N newest episodes. |
| `--max-downloads N` | | Stop after N downloaded titles. |
| `--video-only` / `--audio-only` / `--subs-only` | `-V` / `-A` / `-S` | Restrict track types. |
| `--no-video` / `--no-audio` / `--no-subs` / `--no-chapters` / `--no-attachments` | `-nv` / `-na` / `-ns` / `-nc` / `-nt` | Skip track types. |
| `--worst` | | Lowest-bitrate video at each requested resolution, or at the lowest resolution if none is set. |
| `--require-audio` | | Audio languages that must exist. The title fails if one is missing. |
| `--require-video` | | Video languages that must exist. The title fails if one is missing. |
| `--best-available` | | Degrade gracefully instead of failing. |
| `--skip-missing` | | Skip a title that misses a required language or track, and continue with the next title. |
| `--output` | `-o` | Output directory for this run. |
| `--split-audio` / `--merge-video` / `--no-mux` | | Muxing behaviour. |
| `--postscript` / `--no-postscript` | | Run a command after each output file, or run none. |
| `--proxy` / `--no-proxy` / `--no-proxy-download` / `--proxy-download` | | Proxy control. |
| `--workers` / `--downloads` / `--slow` | | Concurrency and pacing. |
| `--list` / `--list-titles` / `--skip-dl` | | Dry runs. |
| `--cdm-only` / `--vaults-only` | | Content key source control. |
| `--cdm <name>` | | Pin one CDM device, bypassing the `cdm` config mapping. |
| `--export` | | Export track info and keys to JSON. |
| `--tmdb` / `--imdb` / `--tvdb` / `--anilist` / `--enrich` | | Metadata overrides. |
| `--tvdb-order` | | Renumber episodes to a TVDB season order. |
| `-ce` / `--continuous-episodes` | | Number each season on from the season before it. |