Autodetect ffmpeg path if not present in configuration

This commit is contained in:
Maya Doshi
2024-06-26 15:23:04 -07:00
parent 8c66549b9f
commit 17f488910d
+8 -6
View File
@@ -75,13 +75,15 @@ class Download:
if not self.settings.data.path_binary_ffmpeg and ( if not self.settings.data.path_binary_ffmpeg and (
self.settings.data.video_convert_mp4 or self.settings.data.extract_flac self.settings.data.video_convert_mp4 or self.settings.data.extract_flac
): ):
self.settings.data.video_convert_mp4 = False self.settings.data.path_binary_ffmpeg = shutil.which("ffmpeg")
self.settings.data.extract_flac = False if not self.settings.data.path_binary_ffmpeg:
self.settings.data.video_convert_mp4 = False
self.settings.data.extract_flac = False
self.fn_logger.error( self.fn_logger.error(
"FFmpeg is not set. Videos can be downloaded but will not be processed. FLAC cannot be extracted from MP4 containers. " "FFmpeg is not set. Videos can be downloaded but will not be processed. FLAC cannot be extracted from MP4 containers. "
"Make sure FFmpeg is installed and the path to the binary is configured (`path_binary_ffmpeg`)." "Make sure FFmpeg is installed and the path to the binary is configured (`path_binary_ffmpeg`)."
) )
def _download( def _download(
self, self,