Handle exceptions better - YouTube URLs that aren't to videos case an exception.
Currently, it is assumed that all links that have a domain of www.youtube.com
are actually YouTube videos. Maybe be more sure before proceeding:
- Check if there's is a key
v
in the query string. - Check if there is at least one value for that
v
key. - Make sure that video exists (eg handle cases where the thumbnail or
get_video_info
doesn't return an acceptable status code)