Created
May 9, 2015 02:12
-
-
Save stefan2904/dce573e68ac134848f49 to your computer and use it in GitHub Desktop.
Get the title of a YoutTube video by it's video ID
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
from urlparse import urlparse, parse_qs | |
import urllib2 | |
videoid = "bMSTtWtzV-A" | |
title = parse_qs(urlparse("/?" + urllib2.urlopen("http://youtube.com/get_video_info?video_id=" + videoid).read()).query)['title'] | |
print title | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment