From 089ff24f7d940df7b32d68681c37278683eb9d7b Mon Sep 17 00:00:00 2001 From: user1 Date: Wed, 6 Jul 2022 18:59:56 +0200 Subject: [PATCH] [+] Add Flac option --- youtube.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/youtube.sh b/youtube.sh index a2d5551..fc4bfdf 100755 --- a/youtube.sh +++ b/youtube.sh @@ -13,7 +13,7 @@ url="$1" format="$2" [[ -z "${url}" ]] && read -p "URL: " url -[[ -z "${format}" ]] && read -p "Format [opus/m4a/video/hd/fullhd/4k]: " format +[[ -z "${format}" ]] && read -p "Format [opus/flac/m4a/video/hd/fullhd/4k]: " format if [ "$format" == "opus" ] then @@ -21,6 +21,11 @@ then audio="-x" quality="--audio-quality 0" elif [ "$format" == "m4a" ] +then + format="--audio-format flac" + audio="-x" + quality="--audio-quality 0" +elif [ "$format" == "m4a" ] then format="--audio-format m4a" audio="-x" @@ -42,4 +47,4 @@ then format="-f 315+251" fi -yt-dlp -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --embed-thumbnail $format $audio $quality $url +yt-dlp -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --embed-thumbnail --embed-metadata $format $audio $quality $url