2 from __future__ import unicode_literals
4 from .common import InfoExtractor
5 from ..compat import compat_str
13 class TeleQuebecIE(InfoExtractor):
14 _VALID_URL = r'https?://zonevideo\.telequebec\.tv/media/(?P<id>\d+)'
16 'url': 'http://zonevideo.telequebec.tv/media/20984/le-couronnement-de-new-york/couronnement-de-new-york',
17 'md5': 'fe95a0957e5707b1b01f5013e725c90f',
21 'title': 'Le couronnement de New York',
22 'description': 'md5:f5b3d27a689ec6c1486132b2d687d432',
23 'upload_date': '20170201',
24 'timestamp': 1485972222,
28 'url': 'http://zonevideo.telequebec.tv/media/30261',
29 'only_matching': True,
32 def _real_extract(self, url):
33 media_id = self._match_id(url)
34 media_data = self._download_json(
35 'https://mnmedias.api.telequebec.tv/api/v2/media/' + media_id,
38 '_type': 'url_transparent',
41 'limelight:media:' + media_data['streamInfo']['sourceId'],
42 {'geo_countries': ['CA']}),
43 'title': media_data['title'],
44 'description': try_get(
45 media_data, lambda x: x['descriptions'][0]['text'], compat_str),
46 'duration': int_or_none(
47 media_data.get('durationInMilliseconds'), 1000),
48 'ie_key': 'LimelightMedia',