Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import utils, re
- from urlmanaggio import *
- class RaiTV:
- urlazzo = 'http://www.rai.tv/dl/RaiTV/programmi/media/ContentItem-%s.html'
- def __init__(self, content_id, path='./video.mp4'):
- self.content_id = content_id
- self.path = path
- self.getVideo()
- def getVideo(self):
- html = utils.URL2html(self.urlazzo % self.content_id)
- url1 = re.findall('<meta name="videourl" content="([^"]+)"/>', html)[0]
- um1 = URLManaggio(url1)
- if um1.isVideo():
- um1.save(self.path)
- else:
- file1 = um1.readAll()
- url2 = 'http%s' % (re.findall('HREF="(.*)"', file1)[0][3:])
- file2 = URLManaggio(url2).readAll()
- url3 = re.findall('Ref2=(.*)\r', file2)[0]
- URLManaggio(url3).save(self.path)
- #RaiTV('df80db61-1750-47d9-ad73-ead09feb215b')
- #RaiTV('2ff84f96-793b-4edb-bb18-b64633dffbbf')
- RaiTV('0520971b-4d3a-4209-b69c-00a10b6a1b33')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement