From aa38d3d5afec8860cf7a8f9e4ced88b620ec2b0f Mon Sep 17 00:00:00 2001 From: jorgevasquezp Date: Wed, 20 Mar 2019 19:28:25 -0700 Subject: [PATCH] script to inyeract with youtube more efficently --- bash/getyt.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 bash/getyt.sh diff --git a/bash/getyt.sh b/bash/getyt.sh new file mode 100755 index 0000000..ff14f2d --- /dev/null +++ b/bash/getyt.sh @@ -0,0 +1,10 @@ +qurl="https://www.youtube.com/results?search_query=" +qstring="Octonauts Poison Dart Frogs" + +for i; + + do temp=$(curl -s $qurl$(echo $i | sed 's/\s/+/g') | grep -o href\=\"\/watch\?v\=[^\"]* | head -1) + code=$(echo $temp | sed 's/href\=\"\/watch\>?v\=//') + echo $code + youtube-dl -f bestvideo+bestaudio "https://www.youtube.com/watch?v="$code +done;