From 17f488910d447465826ebb8706a607d27516e425 Mon Sep 17 00:00:00 2001 From: Maya Doshi Date: Wed, 26 Jun 2024 15:23:04 -0700 Subject: [PATCH 1/2] Autodetect ffmpeg path if not present in configuration --- tidal_dl_ng/download.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py index c4b786f..9eae10c 100644 --- a/tidal_dl_ng/download.py +++ b/tidal_dl_ng/download.py @@ -75,13 +75,15 @@ class Download: 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 = False - self.settings.data.extract_flac = False + self.settings.data.path_binary_ffmpeg = shutil.which("ffmpeg") + 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( - "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`)." - ) + self.fn_logger.error( + "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`)." + ) def _download( self, From cce5886e5ca594bea811ec0e852fd0844ae93f72 Mon Sep 17 00:00:00 2001 From: Maya Doshi Date: Tue, 2 Jul 2024 16:26:15 -0700 Subject: [PATCH 2/2] Update text to indicate that 'path_binary_ffmpeg' is optional --- tidal_dl_ng/download.py | 2 +- tidal_dl_ng/model/cfg.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py index 9eae10c..90e1d75 100644 --- a/tidal_dl_ng/download.py +++ b/tidal_dl_ng/download.py @@ -82,7 +82,7 @@ class Download: self.fn_logger.error( "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. The path to the binary can be specified (`path_binary_ffmpeg`)." ) def _download( diff --git a/tidal_dl_ng/model/cfg.py b/tidal_dl_ng/model/cfg.py index 0b24854..41364c1 100644 --- a/tidal_dl_ng/model/cfg.py +++ b/tidal_dl_ng/model/cfg.py @@ -70,9 +70,9 @@ class HelpSettings: format_video: str = "Where to download videos and how to name the items." video_convert_mp4: str = ( "Videos are downloaded as MPEG Transport Stream (TS) files. With this option each video " - "will be converted to MP4. FFmpeg must be installed and the binary path must be configured." + "will be converted to MP4. FFmpeg must be installed." ) - path_binary_ffmpeg: str = "If you like to convert videos, this must point to your installed ffmpeg binary." + path_binary_ffmpeg: str = "Path to FFmpeg binary. Only necesarry if FFmpeg not present in path." metadata_cover_dimension: str = ( "The dimensions of the cover image embedded into the track. Possible values: 320x320, 640x640x 1280x1280." )