Last active
September 18, 2017 16:59
-
-
Save ikkentim/7ff6ad8d8617224aae9ecf6e58be6ef7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Draai met
bash youtubetest.sh
, met input.txt ernaast