script to inyeract with youtube more efficently

This commit is contained in:
jorgevasquezp
2019-03-20 19:28:25 -07:00
parent 3fe6921180
commit aa38d3d5af
Executable
+10
View File
@@ -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;