Fetch youtube video title and category from url using youtube api v3
<p>I'm a total beginner at this! I want to fetch the title of a youtube video and also it's category from the Url in python.</p>

<pre><code>import lxml
from lxml import etree
youtube = etree.HTML(urllib.urlopen("http://www.youtube.com/watch?v=KQEOBZLx-Z8").read())
video_title = youtube.xpath("//span[@id='eow-title']/@title")
print ''.join(video_title)
</code></pre>

<p>Output : '12 Days of Christmas -  Christmas Carol'  </p>

<p>I've tried the <code>lxml</code> module to obtain the title but it doesn't work for all videos and I wish to use the youtube api v3. But how do I start, I went through a lot of sites and tried to take help but I always get an error on my console. I have created the server key for my project at <a href="https://console.developers.google.com" rel="nofollow">https://console.developers.google.com</a>, what should I do now? I went through the official page but couldn't undestand much. Where should I start? I also looked at a couple of other SO questions and the codes didn't work for me.  </p>

<pre><code> import urllib
 import simplejson

 id = 'KQEOBZLx-Z8'
 url = 'http://gdata.youtube.com/feeds/api/videos/%s?alt=json&amp;v=2' % id

 json = simplejson.load(urllib.urlopen(url))

 title = json['entry']['title']['$t']
 author = json['entry']['author'][0]['name']

 print "id:%s\nauthor:%s\ntitle:%s" % (id, author, title)  
</code></pre>

<p>What should I do?</p>