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