diff options
author | Steph Enders <steph@senders.io> | 2024-08-19 10:17:11 -0400 |
---|---|---|
committer | Steph Enders <steph@senders.io> | 2024-08-19 10:17:11 -0400 |
commit | c02e9371462308e53c337807b9bc3ee11a964ae0 (patch) | |
tree | f7ec01acb934c207219bb778191d68d40968a3ac | |
parent | 8257c377f884e950262df99d6e31cad3da038ab1 (diff) |
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
-rwxr-xr-x | yt-dlp-best | 4 |
1 files 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) |