6 from .common import InfoExtractor
13 class WatIE(InfoExtractor):
14 _VALID_URL=r'http://www.wat.tv/.*-(?P<shortID>.*?)_.*?.html'
17 u'url': u'http://www.wat.tv/video/world-war-philadelphia-vost-6bv55_2fjr7_.html',
18 u'file': u'6bv55.mp4',
19 u'md5': u'0a4fe7870f31eaeabb5e25fd8da8414a',
21 u"title": u"World War Z - Philadelphia VOST"
25 def _real_extract(self, url):
26 mobj = re.match(self._VALID_URL, url)
27 short_id = mobj.group('shortID')
29 player_data = compat_urllib_parse.urlencode({'shortVideoId': short_id,
31 player_info = self._download_webpage('http://www.wat.tv/player?' + player_data,
32 short_id, u'Downloading player info')
33 player = json.loads(player_info)['player']
34 html5_player = self._html_search_regex(r'iframe src="(.*?)"', player,
36 player_webpage = self._download_webpage(html5_player, short_id,
37 u'Downloading player webpage')
39 video_url = self._search_regex(r'urlhtml5 : "(.*?)"', player_webpage,
41 title = self._search_regex(r'contentTitle : "(.*?)"', player_webpage,
43 thumbnail = self._search_regex(r'previewMedia : "(.*?)"', player_webpage,
45 return {'id': short_id,
49 'thumbnail': thumbnail,
52 class TF1IE(InfoExtractor):
54 TF1 uses the wat.tv player, currently it can only download videos with the
55 html5 player enabled, it cannot download HD videos or the news.
57 _VALID_URL = r'http://videos.tf1.fr/.*-(.*?).html'
59 u'url': u'http://videos.tf1.fr/auto-moto/citroen-grand-c4-picasso-2013-presentation-officielle-8062060.html',
60 u'file': u'6bysb.mp4',
61 u'md5': u'66789d3e91278d332f75e1feb7aea327',
63 u"title": u"Citroën Grand C4 Picasso 2013 : présentation officielle"
67 def _real_extract(self, url):
68 mobj = re.match(self._VALID_URL, url)
70 webpage = self._download_webpage(url, id)
71 embed_url = self._html_search_regex(r'"(https://www.wat.tv/embedframe/.*?)"',
73 embed_page = self._download_webpage(embed_url, id, u'Downloading embed player page')
74 wat_id = self._search_regex(r'UVID=(.*?)&', embed_page, 'wat id')
75 wat_info = self._download_webpage('http://www.wat.tv/interface/contentv3/%s' % wat_id, id, u'Downloading Wat info')
76 wat_info = json.loads(wat_info)['media']
77 wat_url = wat_info['url']
78 return self.url_result(wat_url, 'Wat')