mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-13 12:35:05 +00:00
feat(dl): add --require-audio/--require-video and --warn-only alias
Gate a title on audio or video languages that must exist, independent of what -l/-al/-vl select. --require-subs joins the same gate: its --s-lang conflict and download-all side effect are gone, so -sl now decides what to keep. Requiring a language that is also excluded fails at parse time.
This commit is contained in:
@@ -79,7 +79,7 @@ unshackle dl [OPTIONS] SERVICE [SERVICE ARGS...]
|
||||
| `-c`, `--channels` | - | Audio channels; matches sub-layouts (5.1 ≈ 6.0). |
|
||||
| `-naa`, `--noatmos` | off | Exclude Dolby Atmos audio tracks. |
|
||||
| `--worst` | off | Pick the lowest bitrate within the requested quality. **Requires `-q`.** |
|
||||
| `--best-available` | off | Continue with the best available if a requested resolution/language is absent, instead of failing. |
|
||||
| `--best-available`, `--warn-only` | off | Warn and continue when a requested resolution, range, or language is absent, instead of failing. |
|
||||
| `-rvb`, `--real-video-bitrate` | off | Probe real media size for true video bitrates, overriding the manifest. |
|
||||
| `-rab`, `--real-audio-bitrate` | off | Same for audio (slower). |
|
||||
|
||||
@@ -94,7 +94,9 @@ unshackle dl [OPTIONS] SERVICE [SERVICE ARGS...]
|
||||
| `-vl`, `--v-lang` | - | Video-only language (overrides `-l` for video). A `-` prefix excludes. |
|
||||
| `-al`, `--a-lang` | - | Audio-only language (overrides `-l` for audio). A `-` prefix excludes. |
|
||||
| `-sl`, `--s-lang` | `all` | Subtitle language(s). A `-` prefix excludes, e.g. `all,-es`. |
|
||||
| `--require-subs` | - | Required subtitle langs; keeps **all** subs only if these exist. **Cannot combine with `--s-lang`.** |
|
||||
| `--require-audio` | - | Audio langs that must exist. The title fails even with `--best-available`. Does not select tracks. |
|
||||
| `--require-video` | - | Video langs that must exist. The title fails even with `--best-available`. Does not select tracks. |
|
||||
| `--require-subs` | - | Subtitle langs that must exist. Fails the title if one is missing. `--s-lang` still decides what to keep. |
|
||||
| `-fs`, `--forced-subs` | off | Include forced subtitle tracks. |
|
||||
| `-fsl`, `--forced-s-lang` | none | Language(s) wanted for forced subtitles; implies `-fs`. A `-` prefix excludes. |
|
||||
| `--exact-lang` | off | Exact matching only: `-l es-419` matches `es-419`, not `es-ES`. Applies to selection and to sort order. |
|
||||
@@ -212,7 +214,7 @@ order the service used, then renumbers the episodes into the order you asked for
|
||||
| `--slow` | - | Inter-title delay. Bare `--slow` = 60-120s; `--slow 20-40` = custom range (minimum 20s). |
|
||||
|
||||
!!! warning "Some flags cannot be combined"
|
||||
`--require-subs` and `--s-lang` are mutually exclusive. `--select-titles` and `--wanted` are mutually exclusive. `--worst` needs `--quality`. `--vbitrate` and `--vbitrate-range` (and the audio equivalents) are mutually exclusive.
|
||||
`--select-titles` and `--wanted` are mutually exclusive. `--worst` needs `--quality`. `--vbitrate` and `--vbitrate-range` (and the audio equivalents) are mutually exclusive.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ By default a missing requested resolution is an error. Two flags change that:
|
||||
|
||||
| Flag | Behaviour |
|
||||
| --- | --- |
|
||||
| `--best-available` | If the requested resolution(s) are not present, continue with the best that *is* available instead of failing. Also softens missing video/audio/subtitle languages and hybrid fallbacks. |
|
||||
| `--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/audio/subtitle languages and hybrid fallbacks. |
|
||||
| `--worst` | Within the specified quality, pick the **lowest** bitrate rendition. **Requires `-q/--quality`.** |
|
||||
|
||||
```shell title="Never fail on a missing resolution"
|
||||
@@ -364,12 +364,42 @@ except Spanish, forced Spanish subtitles included.
|
||||
|
||||
### Requiring subtitles
|
||||
|
||||
`--require-subs` takes a list of languages that **must** exist. If they all exist,
|
||||
unshackle downloads *all* subtitles. If any is missing, the title fails. This is useful
|
||||
when you want a download only if a specific subtitle track is present.
|
||||
`--require-subs` 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.
|
||||
|
||||
!!! warning "Cannot combine with `--s-lang`"
|
||||
`--require-subs` and `--s-lang` are mutually exclusive. Use one or the other.
|
||||
It gates the title. It does not select tracks: `--s-lang` still decides what to keep, and
|
||||
it defaults to `all`:
|
||||
|
||||
```bash
|
||||
# every subtitle language, but only if English is one of them
|
||||
unshackle dl --require-subs en EXAMPLE 0ABC123
|
||||
|
||||
# English, Korean and Japanese only, and only if English is present
|
||||
unshackle dl -sl en,ko,ja --require-subs en EXAMPLE 0ABC123
|
||||
```
|
||||
|
||||
### Requiring audio and video languages
|
||||
|
||||
`--require-audio` and `--require-video` take a list of languages that **must** exist. If
|
||||
one is missing, the title fails, even under `--best-available` / `--warn-only`. Like
|
||||
`--require-subs`, they gate the title without selecting tracks: `-l` / `-al` / `-vl` still
|
||||
decide what unshackle downloads.
|
||||
|
||||
This matters most with `-l best` or `-l all`, which accept whatever the service offers and
|
||||
so never report a missing language on their own:
|
||||
|
||||
```bash
|
||||
# every audio language except French, but only if English is one of them
|
||||
unshackle dl -l best,-fr --require-audio en EXAMPLE 0ABC123
|
||||
|
||||
# English is required, French is optional
|
||||
unshackle dl -l en,fr --require-audio en --warn-only EXAMPLE 0ABC123
|
||||
```
|
||||
|
||||
The check runs against the full track list, before any language selection or exclusion.
|
||||
`orig` resolves to the title language, and `--exact-lang` applies. Audio carried inside the
|
||||
video track counts. `--no-audio` and `--no-video` drop the matching requirement.
|
||||
|
||||
### Forced subtitles and output format
|
||||
|
||||
@@ -904,6 +934,8 @@ authoritative list.
|
||||
| `--video-only` / `--audio-only` / `--subs-only` | `-V` / `-A` / `-S` | Restrict track types. |
|
||||
| `--no-video` / `--no-audio` / `--no-subs` / `--no-chapters` | `-nv` / `-na` / `-ns` / `-nc` | Skip track types. |
|
||||
| `--worst` | | Lowest bitrate within `-q`. |
|
||||
| `--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. |
|
||||
| `--output` | `-o` | Output directory for this run. |
|
||||
| `--split-audio` / `--merge-video` / `--no-mux` | | Muxing behaviour. |
|
||||
|
||||
Reference in New Issue
Block a user