def _is_youtube_url(url):
 parsed_url = urlparse(url)
 netloc = parsed_url.netloc
 return (netloc in ['youtu.be', 'youtube.com', 'www.youtube.com'])

def _is_youtube_url ( url ) : parsed_url = urlparse ( url ) netloc = parsed_url . netloc return ( netloc in [ 'youtu.be' , 'youtube.com' , 'www.youtube.com' ] )
returns true if the url is to youtube .