mirror of
https://github.com/xdtianyu/scripts.git
synced 2025-09-24 04:59:21 +08:00
Update youtube.sh
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user