Allow multiple word queries for youtube script

This commit is contained in:
Miles Alan 2020-09-10 19:07:43 -05:00
parent bbdf195090
commit 47eda92e03

View file

@ -6,7 +6,7 @@ AUDIOONLY=0
youtubesearch() {
QUERY="$1"
NRESULTS="$2"
youtube-dl -f '[height<420]' -e --get-id --get-duration ytsearch$NRESULTS:$QUERY |
youtube-dl -f '[height<420]' -e --get-id --get-duration "ytsearch$NRESULTS:$QUERY" |
paste - - - -d ' ' |
awk -F" " '{DUR=$NF; NF-=1; print DUR " " $0}' |
sed -E 's#([^ ]+)$#ytdl://\1#g'