Automatically determine download format...
This commit is contained in:
5
ytdl.sh
5
ytdl.sh
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user