From fb32de243f60a5ad02112302466034c6e342193e Mon Sep 17 00:00:00 2001 From: DARKZOUL5 Date: Wed, 15 Oct 2025 19:07:32 +0300 Subject: [PATCH] Add conditional check to only require ffmpeg if download_mode is audio --- yt-playlist-main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yt-playlist-main.py b/yt-playlist-main.py index 84bb0ab..40bc4d4 100644 --- a/yt-playlist-main.py +++ b/yt-playlist-main.py @@ -74,8 +74,13 @@ class ConfigLoader: # Validate binaries self._check_binary(self.yt_dlp_path, "yt-dlp") - self._check_binary(self.ffmpeg_path, "ffmpeg") self._check_binary(self.aria2c_path, "aria2c") + # Only require ffmpeg if download_mode is audio + if self.download_mode == "audio": + self._check_binary(self.ffmpeg_path, "ffmpeg") + if not shutil.which(self.ffmpeg_path) and not Path(self.ffmpeg_path).is_file(): + print(f"{FAIL} ffmpeg is required for audio mode but was not found.\nPlease install ffmpeg or set the correct path in yt-playlist-config.json.") + sys.exit(1) def _create_default_config(self): with self.config_path.open("w", encoding="utf-8") as f: