Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib2, re, json
- class Youtube:
- def __init__(self, video_id):
- self.video_id = video_id
- larobba = urllib2.urlopen(urllib2.Request('http://youtube.com/watch?v=%s' % video_id)).read()
- pattern = 'ytplayer.config = (.*);</script>'
- maggie = re.findall(pattern, larobba)[0]
- tuttoquanto = json.loads(maggie)
- print tuttoquanto
- Youtube('6PGpn6Iw50g')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement