[BUGFIX] keep_max_files=0 downloading 2 (#893)
Fixes https://github.com/jmbannon/ytdl-sub/issues/892 Does not set max_downloads if keep_max_files = 0
This commit is contained in:
parent
305d084a6d
commit
b9d05c5b8f
1 changed files with 5 additions and 3 deletions
|
|
@ -95,10 +95,12 @@ class SubscriptionYTDLOptions:
|
||||||
if self._preset.output_options.maintain_download_archive:
|
if self._preset.output_options.maintain_download_archive:
|
||||||
ytdl_options["download_archive"] = self._enhanced_download_archive.working_file_path
|
ytdl_options["download_archive"] = self._enhanced_download_archive.working_file_path
|
||||||
if self._preset.output_options.keep_max_files:
|
if self._preset.output_options.keep_max_files:
|
||||||
# yt-dlp has a weird bug with max_downloads=1, set to 2 for safe measure
|
keep_max_files = int(
|
||||||
ytdl_options["max_downloads"] = max(
|
self._overrides.apply_formatter(self._preset.output_options.keep_max_files)
|
||||||
int(self._overrides.apply_formatter(self._preset.output_options.keep_max_files)), 2
|
|
||||||
)
|
)
|
||||||
|
if keep_max_files > 0:
|
||||||
|
# yt-dlp has a weird bug with max_downloads=1, set to 2 for safe measure
|
||||||
|
ytdl_options["max_downloads"] = max(keep_max_files, 2)
|
||||||
|
|
||||||
return ytdl_options
|
return ytdl_options
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue