From 0eed3fe530d6ff4b668494c5b1d4d6fc1ade96f7 Mon Sep 17 00:00:00 2001 From: bashonly <88596187+bashonly@users.noreply.github.com> Date: Tue, 18 Nov 2025 18:23:00 -0600 Subject: [PATCH] [pp/ffmpeg] Fix uncaught error if bad --ffmpeg-location is given (#15104) Revert 9f77e04c76e36e1cbbf49bc9eb385fa6ef804b67 Closes #12829 Authored by: bashonly --- yt_dlp/downloader/external.py | 2 ++ yt_dlp/postprocessor/ffmpeg.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/yt_dlp/downloader/external.py b/yt_dlp/downloader/external.py index 82bc5106a5..14879b358d 100644 --- a/yt_dlp/downloader/external.py +++ b/yt_dlp/downloader/external.py @@ -457,6 +457,8 @@ class FFmpegFD(ExternalFD): @classmethod def available(cls, path=None): + # TODO: Fix path for ffmpeg + # Fixme: This may be wrong when --ffmpeg-location is used return FFmpegPostProcessor().available def on_process_started(self, proc, stdin): diff --git a/yt_dlp/postprocessor/ffmpeg.py b/yt_dlp/postprocessor/ffmpeg.py index 5c9c0390d9..a850bdd102 100644 --- a/yt_dlp/postprocessor/ffmpeg.py +++ b/yt_dlp/postprocessor/ffmpeg.py @@ -192,7 +192,10 @@ class FFmpegPostProcessor(PostProcessor): @property def available(self): - return bool(self._ffmpeg_location.get()) or self.basename is not None + # If we return that ffmpeg is available, then the basename property *must* be run + # (as doing so has side effects), and its value can never be None + # See: https://github.com/yt-dlp/yt-dlp/issues/12829 + return self.basename is not None @property def executable(self):