2 from __future__ import unicode_literals
4 from .common import InfoExtractor
13 class TVAIE(InfoExtractor):
14 _VALID_URL = r'https?://videos?\.tva\.ca/details/_(?P<id>\d+)'
16 'url': 'https://videos.tva.ca/details/_5596811470001',
18 'id': '5596811470001',
20 'title': 'Un extrait de l\'Ă©pisode du dimanche 8 octobre 2017 !',
21 'uploader_id': '5481942443001',
22 'upload_date': '20171003',
23 'timestamp': 1507064617,
27 'skip_download': True,
29 'skip': 'HTTP Error 404: Not Found',
31 'url': 'https://video.tva.ca/details/_5596811470001',
32 'only_matching': True,
34 BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/5481942443001/default_default/index.html?videoId=%s'
36 def _real_extract(self, url):
37 video_id = self._match_id(url)
40 '_type': 'url_transparent',
42 'url': smuggle_url(self.BRIGHTCOVE_URL_TEMPLATE % video_id, {'geo_countries': ['CA']}),
43 'ie_key': 'BrightcoveNew',
47 class QubIE(InfoExtractor):
48 _VALID_URL = r'https?://(?:www\.)?qub\.ca/(?:[^/]+/)*[0-9a-z-]+-(?P<id>\d+)'
50 'url': 'https://www.qub.ca/tvaplus/tva/alerte-amber/saison-1/episode-01-1000036619',
51 'md5': '949490fd0e7aee11d0543777611fbd53',
53 'id': '6084352463001',
55 'title': 'Épisode 01',
56 'uploader_id': '5481942443001',
57 'upload_date': '20190907',
58 'timestamp': 1567899756,
59 'description': 'md5:9c0d7fbb90939420c651fd977df90145',
62 'url': 'https://www.qub.ca/tele/video/lcn-ca-vous-regarde-rev-30s-ap369664-1009357943',
63 'only_matching': True,
65 # reference_id also works with old account_id(5481942443001)
66 # BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/5813221784001/default_default/index.html?videoId=ref:%s'
68 def _real_extract(self, url):
69 entity_id = self._match_id(url)
70 entity = self._download_json(
71 'https://www.qub.ca/proxy/pfu/content-delivery-service/v1/entities',
72 entity_id, query={'id': entity_id})
73 video_id = entity['videoId']
74 episode = strip_or_none(entity.get('name'))
77 '_type': 'url_transparent',
80 # 'url': self.BRIGHTCOVE_URL_TEMPLATE % entity['referenceId'],
81 'url': 'https://videos.tva.ca/details/_' + video_id,
82 'description': entity.get('longDescription'),
83 'duration': float_or_none(entity.get('durationMillis'), 1000),
85 'episode_number': int_or_none(entity.get('episodeNumber')),
86 # 'ie_key': 'BrightcoveNew',
87 'ie_key': TVAIE.ie_key(),