2 from __future__ import unicode_literals
4 from .common import InfoExtractor
12 class EyedoTVIE(InfoExtractor):
13 _VALID_URL = r'https?://(?:www\.)?eyedo\.tv/[^/]+/(?:#!/)?Live/Detail/(?P<id>[0-9]+)'
15 'url': 'https://www.eyedo.tv/en-US/#!/Live/Detail/16301',
16 'md5': 'ba14f17995cdfc20c36ba40e21bf73f7',
20 'title': 'Journée du conseil scientifique de l\'Afnic 2015',
21 'description': 'md5:4abe07293b2f73efc6e1c37028d58c98',
22 'uploader': 'Afnic Live',
23 'uploader_id': '8023',
26 _ROOT_URL = 'http://live.eyedo.net:1935/'
28 def _real_extract(self, url):
29 video_id = self._match_id(url)
30 video_data = self._download_xml('http://eyedo.tv/api/live/GetLive/%s' % video_id, video_id)
33 return self._xpath_ns(path, 'http://schemas.datacontract.org/2004/07/EyeDo.Core.Implementation.Web.ViewModels.Api')
35 title = xpath_text(video_data, _add_ns('Titre'), 'title', True)
36 state_live_code = xpath_text(video_data, _add_ns('StateLiveCode'), 'title', True)
37 if state_live_code == 'avenir':
39 '%s said: We\'re sorry, but this video is not yet available.' % self.IE_NAME,
42 is_live = state_live_code == 'live'
44 # http://eyedo.tv/Content/Html5/Scripts/html5view.js
46 if xpath_text(video_data, 'Cdn') == 'true':
47 m3u8_url = 'http://rrr.sz.xlcdn.com/?account=eyedo&file=A%s&type=live&service=wowza&protocol=http&output=playlist.m3u8' % video_id
49 m3u8_url = self._ROOT_URL + 'w/%s/eyedo_720p/playlist.m3u8' % video_id
51 m3u8_url = self._ROOT_URL + 'replay-w/%s/mp4:%s.mp4/playlist.m3u8' % (video_id, video_id)
56 'formats': self._extract_m3u8_formats(
57 m3u8_url, video_id, 'mp4', 'm3u8' if is_live else 'm3u8_native'),
58 'description': xpath_text(video_data, _add_ns('Description')),
59 'duration': parse_duration(xpath_text(video_data, _add_ns('Duration'))),
60 'uploader': xpath_text(video_data, _add_ns('Createur')),
61 'uploader_id': xpath_text(video_data, _add_ns('CreateurId')),
62 'chapter': xpath_text(video_data, _add_ns('ChapitreTitre')),
63 'chapter_id': xpath_text(video_data, _add_ns('ChapitreId')),