Update youtube.sh
This commit is contained in:
parent
867283fbc7
commit
fe2ac78195
|
@ -1,10 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# pip install youtube-dl
|
|
||||||
|
|
||||||
URI=$1
|
URI=$1
|
||||||
|
|
||||||
|
export LC_ALL=en_US.UTF-8
|
||||||
|
|
||||||
AUDIO=$(youtube-dl -F $URI | grep "DASH audio"|grep "aac"|tail -1|cut -d ' ' -f 1)
|
AUDIO=$(youtube-dl -F $URI | grep "DASH audio"|grep "aac"|tail -1|cut -d ' ' -f 1)
|
||||||
VIDEO=$(youtube-dl -F $URI | grep "DASH video"|grep "mp4"|tail -1|cut -d ' ' -f 1)
|
VIDEO=$(youtube-dl -F $URI | grep "DASH video"|grep "mp4"|tail -1|cut -d ' ' -f 1)
|
||||||
|
|
||||||
youtube-dl -f $VIDEO+$AUDIO -k $URI
|
youtube-dl -v -f $VIDEO+$AUDIO -k $URI
|
||||||
|
|
||||||
|
NAME=$(echo "$URI" |cut -d '=' -f 2)
|
||||||
|
|
||||||
|
SAVEIFS=$IFS
|
||||||
|
IFS=$(echo -en "\n\b")
|
||||||
|
|
||||||
|
FILES=($(ls -- *$NAME*))
|
||||||
|
|
||||||
|
for FILE in "${FILES[@]}"; do
|
||||||
|
echo $FILE
|
||||||
|
done
|
||||||
|
|
||||||
|
IFS=$SAVEIFS
|
||||||
|
|
Loading…
Reference in New Issue