From 55604140337ae635d20983ae6ea0a1781b61ad8d Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Thu, 17 Jul 2025 16:09:01 +0200 Subject: Select video only format, use best audio --- yt-dl-choose | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/yt-dl-choose b/yt-dl-choose index 7d33588..63a78a7 100755 --- a/yt-dl-choose +++ b/yt-dl-choose @@ -22,15 +22,14 @@ if [[ $NO_PLAYLIST ]]; then URL=`echo "$URL" | sed -e 's/&list=.*&/\&/'` fi -formats=`yt-dlp --list-formats $URL \ - | grep -v "audio only" \ - | grep -v "video only" \ - | grep -v mhtml \ - | sed '0,/---------/d' ` -format=`echo "$formats" | dmenu | cut -d' ' -f1` - -if [ -z "$format" ]; then +video_formats=`yt-dlp --list-formats $URL \ + | grep "video only" \ + | grep -v mhtml` +echo "video formats are:\n$video_formats" +video_format=`echo "$video_formats" | dmenu | cut -d' ' -f1` + +if [ -z "$video_format" ]; then exit 0; fi -mpv --ytdl-format=$format $1 +mpv --ytdl-format="$video_format+bestaudio" $URL -- cgit v1.2.3