From 608b0128b80a0dc55cf3ee87b63df6c816ef9516 Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Tue, 11 Mar 2025 20:59:08 +0300 Subject: [PATCH 1/2] Made it possible to not use format in preset --- app/library/YTDLPOpts.py | 6 ++++-- ui/components/PresetForm.vue | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/library/YTDLPOpts.py b/app/library/YTDLPOpts.py index 7e1c062d..84f52802 100644 --- a/app/library/YTDLPOpts.py +++ b/app/library/YTDLPOpts.py @@ -82,8 +82,7 @@ class YTDLPOpts(metaclass=Singleton): self._preset_opts["cookiefile"] = str(file) - if preset.format: - self._preset_opts["format"] = preset.format + self._preset_opts["format"] = preset.format if preset.template: self._preset_opts["outtmpl"] = {"default": preset.template, "chapter": self._config.output_template_chapter} @@ -129,4 +128,7 @@ class YTDLPOpts(metaclass=Singleton): self.presets_opts = {} self._item_opts = {} + if "format" in data and "not_set" == data["format"]: + data["format"] = None + return data diff --git a/ui/components/PresetForm.vue b/ui/components/PresetForm.vue index 4419bc38..e4ef9d5e 100644 --- a/ui/components/PresetForm.vue +++ b/ui/components/PresetForm.vue @@ -111,7 +111,8 @@ The yt-dlp [--format, -f] video format code. see this - url for more info. + url for more info.. Note, as this key is required, you can set the value to not_set + to use the default yt-dlp format. From 15969542abaf0ca411045c86a50c4d8a239bbf90 Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Tue, 11 Mar 2025 21:06:29 +0300 Subject: [PATCH 2/2] restore check for format in preset compiling for YTDLPOpts --- app/library/YTDLPOpts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/library/YTDLPOpts.py b/app/library/YTDLPOpts.py index 84f52802..b989f062 100644 --- a/app/library/YTDLPOpts.py +++ b/app/library/YTDLPOpts.py @@ -82,7 +82,8 @@ class YTDLPOpts(metaclass=Singleton): self._preset_opts["cookiefile"] = str(file) - self._preset_opts["format"] = preset.format + if preset.format: + self._preset_opts["format"] = preset.format if preset.template: self._preset_opts["outtmpl"] = {"default": preset.template, "chapter": self._config.output_template_chapter}