Allow multiple word queries for youtube script

master
Miles Alan 4 years ago
parent bbdf195090
commit 47eda92e03
  1. 2
      scripts/appscripts/sxmo_youtube.sh

@ -6,7 +6,7 @@ AUDIOONLY=0
youtubesearch() { youtubesearch() {
QUERY="$1" QUERY="$1"
NRESULTS="$2" 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 ' ' | paste - - - -d ' ' |
awk -F" " '{DUR=$NF; NF-=1; print DUR " " $0}' | awk -F" " '{DUR=$NF; NF-=1; print DUR " " $0}' |
sed -E 's#([^ ]+)$#ytdl://\1#g' sed -E 's#([^ ]+)$#ytdl://\1#g'

Loading…
Cancel
Save