2016-06-30 11:21:47 -06:00
|
|
|
from .common import InfoExtractor
|
|
|
|
|
|
|
|
|
2016-09-15 01:12:12 -06:00
|
|
|
class BellMediaIE(InfoExtractor):
|
|
|
|
_VALID_URL = r'''(?x)https?://(?:www\.)?
|
|
|
|
(?P<domain>
|
|
|
|
(?:
|
|
|
|
ctv|
|
|
|
|
tsn|
|
2018-05-27 05:11:53 -06:00
|
|
|
bnn(?:bloomberg)?|
|
2016-09-15 01:12:12 -06:00
|
|
|
thecomedynetwork|
|
|
|
|
discovery|
|
|
|
|
discoveryvelocity|
|
|
|
|
sciencechannel|
|
|
|
|
investigationdiscovery|
|
|
|
|
animalplanet|
|
|
|
|
bravo|
|
|
|
|
mtv|
|
2017-03-23 06:48:32 -06:00
|
|
|
space|
|
2019-11-02 15:33:51 -06:00
|
|
|
etalk|
|
|
|
|
marilyn
|
2016-09-15 01:12:12 -06:00
|
|
|
)\.ca|
|
2020-06-23 08:08:50 -06:00
|
|
|
(?:much|cp24)\.com
|
|
|
|
)/.*?(?:\b(?:vid(?:eoid)?|clipId)=|-vid|~|%7E|/(?:episode)?)(?P<id>[0-9]{6,})'''
|
2016-06-30 11:21:47 -06:00
|
|
|
_TESTS = [{
|
2018-05-27 05:11:53 -06:00
|
|
|
'url': 'https://www.bnnbloomberg.ca/video/david-cockfield-s-top-picks~1403070',
|
2022-06-21 01:21:36 -06:00
|
|
|
'md5': '3e5b8e38370741d5089da79161646635',
|
2016-06-30 11:21:47 -06:00
|
|
|
'info_dict': {
|
2018-05-27 05:11:53 -06:00
|
|
|
'id': '1403070',
|
|
|
|
'ext': 'flv',
|
|
|
|
'title': 'David Cockfield\'s Top Picks',
|
|
|
|
'description': 'md5:810f7f8c6a83ad5b48677c3f8e5bb2c3',
|
|
|
|
'upload_date': '20180525',
|
|
|
|
'timestamp': 1527288600,
|
2024-03-08 15:36:41 -07:00
|
|
|
'season_id': '73997',
|
2022-06-21 01:21:36 -06:00
|
|
|
'season': '2018',
|
|
|
|
'thumbnail': 'http://images2.9c9media.com/image_asset/2018_5_25_baf30cbd-b28d-4a18-9903-4bb8713b00f5_PNG_956x536.jpg',
|
|
|
|
'tags': [],
|
|
|
|
'categories': ['ETFs'],
|
|
|
|
'season_number': 8,
|
|
|
|
'duration': 272.038,
|
|
|
|
'series': 'Market Call Tonight',
|
2016-06-30 11:21:47 -06:00
|
|
|
},
|
2016-08-29 11:20:58 -06:00
|
|
|
}, {
|
|
|
|
'url': 'http://www.thecomedynetwork.ca/video/player?vid=923582',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'http://www.tsn.ca/video/expectations-high-for-milos-raonic-at-us-open~939549',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'http://www.bnn.ca/video/berman-s-call-part-two-viewer-questions~939654',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'http://www.ctv.ca/YourMorning/Video/S1E6-Monday-August-29-2016-vid938009',
|
|
|
|
'only_matching': True,
|
2016-09-15 01:12:12 -06:00
|
|
|
}, {
|
|
|
|
'url': 'http://www.much.com/shows/atmidnight/episode948007/tuesday-september-13-2016',
|
|
|
|
'only_matching': True,
|
|
|
|
}, {
|
|
|
|
'url': 'http://www.much.com/shows/the-almost-impossible-gameshow/928979/episode-6',
|
|
|
|
'only_matching': True,
|
2017-02-13 07:08:48 -07:00
|
|
|
}, {
|
|
|
|
'url': 'http://www.ctv.ca/DCs-Legends-of-Tomorrow/Video/S2E11-Turncoat-vid1051430',
|
|
|
|
'only_matching': True,
|
2017-03-23 06:48:32 -06:00
|
|
|
}, {
|
|
|
|
'url': 'http://www.etalk.ca/video?videoid=663455',
|
|
|
|
'only_matching': True,
|
2020-06-23 08:08:50 -06:00
|
|
|
}, {
|
|
|
|
'url': 'https://www.cp24.com/video?clipId=1982548',
|
|
|
|
'only_matching': True,
|
2016-06-30 11:21:47 -06:00
|
|
|
}]
|
2016-09-15 01:12:12 -06:00
|
|
|
_DOMAINS = {
|
|
|
|
'thecomedynetwork': 'comedy',
|
|
|
|
'discoveryvelocity': 'discvel',
|
|
|
|
'sciencechannel': 'discsci',
|
|
|
|
'investigationdiscovery': 'invdisc',
|
|
|
|
'animalplanet': 'aniplan',
|
2017-03-23 06:48:32 -06:00
|
|
|
'etalk': 'ctv',
|
2018-05-27 05:11:53 -06:00
|
|
|
'bnnbloomberg': 'bnn',
|
2019-11-02 15:33:51 -06:00
|
|
|
'marilyn': 'ctv_marilyn',
|
2016-09-15 01:12:12 -06:00
|
|
|
}
|
2016-06-30 11:21:47 -06:00
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2021-08-18 19:41:24 -06:00
|
|
|
domain, video_id = self._match_valid_url(url).groups()
|
2016-09-15 01:12:12 -06:00
|
|
|
domain = domain.split('.')[0]
|
2016-06-30 11:21:47 -06:00
|
|
|
return {
|
|
|
|
'_type': 'url_transparent',
|
|
|
|
'id': video_id,
|
2024-06-11 17:09:58 -06:00
|
|
|
'url': f'9c9media:{self._DOMAINS.get(domain, domain)}_web:{video_id}',
|
2016-06-30 11:21:47 -06:00
|
|
|
'ie_key': 'NineCNineMedia',
|
|
|
|
}
|