Skip to content

Instantly share code, notes, and snippets.

@stefan2904
Created May 9, 2015 02:12
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 stefan2904/dce573e68ac134848f49 to your computer and use it in GitHub Desktop.
Save stefan2904/dce573e68ac134848f49 to your computer and use it in GitHub Desktop.
Get the title of a YoutTube video by it's video ID
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