From 4b8c6d16b07b5fd373c34900bf12a91df0fb6d3c Mon Sep 17 00:00:00 2001 From: Simon Rieger Date: Wed, 23 Apr 2025 08:28:51 +0200 Subject: [PATCH] add bestaudio option --- youtube.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/youtube.sh b/youtube.sh index d0445f3..27cfc7c 100755 --- a/youtube.sh +++ b/youtube.sh @@ -5,7 +5,7 @@ set -ex if [ "$1" == "--help" ] then echo "bash ./youtube-dl.sh URL FORMAT" - echo "Formate: [opus/m4a/video/hd/fullhd/4k]" + echo "Formate: [opus/m4a/video/hd/fullhd/4k/bestaudio]" echo "Extra: (Zusätzliche Parameter)" exit 0 fi @@ -15,7 +15,7 @@ format="$2" extra="$3" [[ -z "${url}" ]] && read -p "URL: " url -[[ -z "${format}" ]] && read -p "Format [opus/flac/m4a/mp4/video/hd/fullhd/4k]: " format +[[ -z "${format}" ]] && read -p "Format [opus/flac/m4a/mp4/video/hd/fullhd/4k/bestaudio]: " format echo "Wenn man für alle Playlisten Unterordner anlegen will: [-o %(playlist_title)s/%(title)s.%(ext)s/--cookies cookies.txt/--cookies-from-browser firefox] (Praktisch für Downloads ganzer Kanäle" [[ -z "${extra}" ]] && read -p "Sind noch zusätzliche Parameter gewünscht?: " extra @@ -57,6 +57,10 @@ then elif [ "$format" == "4k" ] then format="-S "res:2160" -f "bv+ba/b"" +elif [ "$format" == "bestaudio" ] +then + # Lädt das beste Audioformat OHNE Umwandlung (z.B. Opus/WebM oder AAC/M4A) + format="-f bestaudio" fi yt-dlp -i -c --socket-timeout 10000 --force-ipv4 --restrict-filenames --embed-thumbnail --embed-metadata --match-filter "!was_live" ${format} ${audio} ${quality} -v ${url} ${extra}