From c02e9371462308e53c337807b9bc3ee11a964ae0 Mon Sep 17 00:00:00 2001 From: Steph Enders Date: Mon, 19 Aug 2024 10:17:11 -0400 Subject: Ensure only one line of desired format is set in FMT_LINE While this bug didn't cause any issues (that we've found) it muddled the output for the user. This seemed to happen more on older/lower maximum quality videos. We also put "mp4" in a variable "DESIRED_FMT" with the intention of making this a parameter the user can set. However, we're now moving into "just read the params for the script" territory --- yt-dlp-best | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yt-dlp-best b/yt-dlp-best index d4f3f9e..5c2f4cc 100755 --- a/yt-dlp-best +++ b/yt-dlp-best @@ -9,8 +9,8 @@ if [ $# -ne 1 ]; then fi URL=$1 - -FMT_LINE=$(yt-dlp -F "${URL}" | tail -n 2 | grep "mp4") +DESIRED_FMT="mp4" +FMT_LINE=$(yt-dlp -F "${URL}" | grep "${DESIRED_FMT}" | tail -n 1) FMT=$(echo ${FMT_LINE} | cut -d" " -f1) -- cgit v1.2.3-54-g00ecf