url_data = urlparse.urlparse('http://www.youtube.com/watch?v=z_AbfPXTKms&NR=1')
query = urlparse.parse_qs(url_data.query)
video = query['v'][0]
How can I extract video ID from YouTube's link in Python?