Automatically determine download format...

This commit is contained in:
Joe Tretter
2022-08-13 15:00:18 -05:00
parent dd9138871e
commit b0b8ab40f5

View File

@@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
set -x 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} do /usr/bin/stdbuf -i0 -o0 -e0 printf "%3d%% .................................................................................................... \r\n" ${x}
done done