diff --git a/ytdl.sh b/ytdl.sh index 718dd37..c4e9f70 100644 --- a/ytdl.sh +++ b/ytdl.sh @@ -1,5 +1,8 @@ #!/bin/bash set -x -/usr/local/bin/youtube-dl --newline -f 18 "${1}" 2>&1 | /usr/bin/stdbuf -i0 -o0 -e0 cut -c 11-14 | while read x +# get format - I take the first one in the list that does not have audio or video only... +frm=$(youtube-dl -F 'https://www.youtube.com/watch?v=SLWJuKQD030' | grep -v only | head -n4 | tail -n1 | awk -e '{print $1}') + +/usr/local/bin/youtube-dl --newline -f $frm "${1}" 2>&1 | /usr/bin/stdbuf -i0 -o0 -e0 cut -c 11-14 | while read x do /usr/bin/stdbuf -i0 -o0 -e0 printf "%3d%% .................................................................................................... \r\n" ${x} done