Skip to content

Instantly share code, notes, and snippets.

@ikkentim
Last active September 18, 2017 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikkentim/7ff6ad8d8617224aae9ecf6e58be6ef7 to your computer and use it in GitHub Desktop.
Save ikkentim/7ff6ad8d8617224aae9ecf6e58be6ef7 to your computer and use it in GitHub Desktop.
#!/bin/bash
videos=$(grep -cve '^\s*$' input.txt)
echo "Total of $videos videos"
i=1
while read video; do
if [[ $(curl -s http://www.youtube.com/oembed\?url\=https://www.youtube.com/watch\?v\=$(echo $video)\&format\=json) = "Not Found" ]]; then
echo "$i: $video is bad"
echo "$video" >> bad.txt
else
echo "$i: $video is good"
echo "$video" >> good.txt
fi
((i++))
done < input.txt
@ikkentim
Copy link
Author

Draai met bash youtubetest.sh , met input.txt ernaast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment