summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/download.py
diff options
context:
space:
mode:
authorexislow <exislow@users.noreply.github.com>2024-03-22 15:50:23 +0100
committerGitHub <noreply@github.com>2024-03-22 15:50:23 +0100
commit0461c53be4191e18d5bba1e333de0d5ad7527bd0 (patch)
tree4587ab7208dc4435ee119c9f8812325770f0b654 /tidal_dl_ng/download.py
parent134836d471c3accfbf323dbcc27d35a40b48ae6c (diff)
parentd331f93c911c4d008904177de15619b30955227e (diff)
downloadtidal-dl-ng-0461c53be4191e18d5bba1e333de0d5ad7527bd0.tar.gz
Merge pull request #66 from exislow/63-feature-provide-feedback-if-ffmpeg-not-found-on-path
63 feature provide feedback if ffmpeg not found on path
Diffstat (limited to 'tidal_dl_ng/download.py')
-rw-r--r--tidal_dl_ng/download.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py
index 7cdbcca..2afdf20 100644
--- a/tidal_dl_ng/download.py
+++ b/tidal_dl_ng/download.py
@@ -29,7 +29,7 @@ from tidal_dl_ng.constants import (
)
from tidal_dl_ng.helper.decryption import decrypt_file, decrypt_security_token
from tidal_dl_ng.helper.exceptions import MediaMissing, UnknownManifestFormat
-from tidal_dl_ng.helper.path import check_file_exists, format_path_media, path_file_sanitize
+from tidal_dl_ng.helper.path import check_file_exists, format_path_media, is_installed_ffmpeg, path_file_sanitize
from tidal_dl_ng.helper.tidal import (
instantiate_media,
items_results_all,
@@ -82,6 +82,13 @@ class Download:
self.progress = progress
self.path_base = path_base
+ if not is_installed_ffmpeg() and self.settings.data.video_convert_mp4:
+ self.settings.data.video_convert_mp4 = False
+ self.fn_logger.error(
+ "Cannot find FFmpeg in PATH. Videos can be downloaded but will not be processed. "
+ "Make sure FFmpeg is installed correctly and present within your environmental PATH variable."
+ )
+
def _download(
self,
media: Track | Video,
@@ -284,7 +291,9 @@ class Download:
def metadata_write(self, track: Track, path_file: str):
result: bool = False
release_date: str = (
- track.album.available_release_date.strftime("%Y-%m-%d") if track.album.available_release_date else track.album.release_date.strftime("%Y-%m-%d") if track.album.release_date else ""
+ track.album.available_release_date.strftime("%Y-%m-%d")
+ if track.album.available_release_date
+ else track.album.release_date.strftime("%Y-%m-%d") if track.album.release_date else ""
)
copy_right: str = track.copyright if hasattr(track, "copyright") and track.copyright else ""
isrc: str = track.isrc if hasattr(track, "isrc") and track.isrc else ""