From 53fc3a65edf023fd8f7d1c822776a804e45e5be1 Mon Sep 17 00:00:00 2001 From: --set <--set> Date: Fri, 19 Apr 2024 10:52:00 +0200 Subject: [PATCH] ytdl-music: added update check for yt-dlp and ffmpeg requirement --- downloads/ytdl-music.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/downloads/ytdl-music.sh b/downloads/ytdl-music.sh index 9f97265..06ab0c8 100755 --- a/downloads/ytdl-music.sh +++ b/downloads/ytdl-music.sh @@ -10,5 +10,16 @@ if [ -z "$PLAYLISTURL" ]; then exit 1 fi +if ! which ffmpeg > /dev/null 2>&1; then + echo "Error: ffmpeg is not installed. Please install ffmpeg before running this script." + exit 1 +fi + +ffmpeg -version | head -n 1 + +yt-dlp -U || exit $? + +sleep 2 + # Use double quotes for variables within the yt-dlp command yt-dlp -f 'ba' -x --audio-format mp3 "$PLAYLISTURL" -o "$TARGETPATH/$LIBRARY_NAME/%(playlist)s/%(title)s.%(ext)s"