mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-05 07:25:08 +00:00
feat(dl): add --max-downloads to stop a run after N downloaded titles
This commit is contained in:
@@ -453,6 +453,7 @@ Make a download job. It requires `service` and `title_id`. Every other field is
|
||||
| `wanted` | string / string[] | `[]` | Episode/season selectors, as a list or as one comma-separated string. Accepts the part form, `"S01E01.2"`, and the air-date form, `"2026-08-11"` or `"2026-08-01:2026-08-31"`. For a music release, a selector is a number of the track list, `"1-5"` or `"1,3,7"`, or `"{disc}x{track}"` such as `"2x3"`. |
|
||||
| `latest_episode` | boolean | `false` | Only the newest episode. |
|
||||
| `latest_episodes` | integer | `null` | Only the N newest episodes. A positive integer. When set, it overrides `latest_episode`. |
|
||||
| `max_downloads` | integer | `null` | Stop the job after N titles have downloaded. A positive integer. A title in `skipped_titles` or `already_present` does not count. |
|
||||
| `lang` / `v_lang` / `a_lang` / `s_lang` | string[] | `["orig"]` / `[]` / `[]` / `["all"]` | Language filters. A missing `s_lang` language gives a warning and the job continues. |
|
||||
| `require_audio` | string[] | `[]` | Audio languages that must exist. The job fails if one is missing, even with `best_available`, or skips the title with `skip_missing`. |
|
||||
| `require_video` | string[] | `[]` | Video languages that must exist. The job fails if one is missing, even with `best_available`, or skips the title with `skip_missing`. |
|
||||
|
||||
@@ -128,6 +128,7 @@ unshackle honours the special language tokens `orig`, `all`, and `best` everywhe
|
||||
| `--select-titles` | Interactively select what to download: 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. |
|
||||
| `--max-downloads N` | Stop after N titles have downloaded. A skipped title, or a title already in the completion archive, does not count. |
|
||||
| `--list-titles` | List titles only; do not download. |
|
||||
|
||||
### Track-type inclusion / exclusion
|
||||
|
||||
@@ -761,6 +761,7 @@ when you want a part on its own.
|
||||
| `--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.
|
||||
@@ -773,6 +774,17 @@ unshackle dl --latest-episode EXAMPLE 81234567
|
||||
unshackle dl --latest-episodes 3 EXAMPLE 81234567
|
||||
```
|
||||
|
||||
`--latest-episodes` takes the newest episodes. `--max-downloads` takes the first episodes in order.
|
||||
With `--skip-existing`, it takes the next episodes that the
|
||||
[completion archive](../reference/configuration/download.md#completion-archive) does not have, so
|
||||
the same command can run each day:
|
||||
|
||||
```shell title="Grab the next two episodes not downloaded yet"
|
||||
unshackle dl --skip-existing --max-downloads 2 -w S01 EXAMPLE 81234567
|
||||
```
|
||||
|
||||
A season that the limit stops before its last episode gets no `season` post-script event.
|
||||
|
||||
## Including and excluding track types
|
||||
|
||||
You can restrict a download to certain track categories, either positively (only these)
|
||||
@@ -1280,6 +1292,7 @@ authoritative list.
|
||||
| `--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. |
|
||||
|
||||
@@ -159,6 +159,10 @@ and generated/hybrid video outputs also fall back to normal downloading. So does
|
||||
`--skip-subtitle-errors`, which can publish incomplete output. `--include-sample` still records
|
||||
the complete output, not the sample.
|
||||
|
||||
With `--max-downloads N`, a run downloads the next N titles that have no receipt. A title
|
||||
that the archive skips does not count. A mode above that does not update the archive writes no
|
||||
receipt, so each run downloads the same first N titles again.
|
||||
|
||||
This is a completion log, not a media inventory: deleting or moving an output does not remove
|
||||
its receipt. It does not compare audio or subtitle choices or inspect existing files. Use
|
||||
`--force` when an archived variant needs to be downloaded again. It does not import job history,
|
||||
|
||||
Reference in New Issue
Block a user