]> jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/bellmedia.py
[spotify] Detect iframe embeds (#3430)
[yt-dlp.git] / yt_dlp / extractor / bellmedia.py
1 from .common import InfoExtractor
2
3
4 class BellMediaIE(InfoExtractor):
5 _VALID_URL = r'''(?x)https?://(?:www\.)?
6 (?P<domain>
7 (?:
8 ctv|
9 tsn|
10 bnn(?:bloomberg)?|
11 thecomedynetwork|
12 discovery|
13 discoveryvelocity|
14 sciencechannel|
15 investigationdiscovery|
16 animalplanet|
17 bravo|
18 mtv|
19 space|
20 etalk|
21 marilyn
22 )\.ca|
23 (?:much|cp24)\.com
24 )/.*?(?:\b(?:vid(?:eoid)?|clipId)=|-vid|~|%7E|/(?:episode)?)(?P<id>[0-9]{6,})'''
25 _TESTS = [{
26 'url': 'https://www.bnnbloomberg.ca/video/david-cockfield-s-top-picks~1403070',
27 'md5': '36d3ef559cfe8af8efe15922cd3ce950',
28 'info_dict': {
29 'id': '1403070',
30 'ext': 'flv',
31 'title': 'David Cockfield\'s Top Picks',
32 'description': 'md5:810f7f8c6a83ad5b48677c3f8e5bb2c3',
33 'upload_date': '20180525',
34 'timestamp': 1527288600,
35 },
36 }, {
37 'url': 'http://www.thecomedynetwork.ca/video/player?vid=923582',
38 'only_matching': True,
39 }, {
40 'url': 'http://www.tsn.ca/video/expectations-high-for-milos-raonic-at-us-open~939549',
41 'only_matching': True,
42 }, {
43 'url': 'http://www.bnn.ca/video/berman-s-call-part-two-viewer-questions~939654',
44 'only_matching': True,
45 }, {
46 'url': 'http://www.ctv.ca/YourMorning/Video/S1E6-Monday-August-29-2016-vid938009',
47 'only_matching': True,
48 }, {
49 'url': 'http://www.much.com/shows/atmidnight/episode948007/tuesday-september-13-2016',
50 'only_matching': True,
51 }, {
52 'url': 'http://www.much.com/shows/the-almost-impossible-gameshow/928979/episode-6',
53 'only_matching': True,
54 }, {
55 'url': 'http://www.ctv.ca/DCs-Legends-of-Tomorrow/Video/S2E11-Turncoat-vid1051430',
56 'only_matching': True,
57 }, {
58 'url': 'http://www.etalk.ca/video?videoid=663455',
59 'only_matching': True,
60 }, {
61 'url': 'https://www.cp24.com/video?clipId=1982548',
62 'only_matching': True,
63 }]
64 _DOMAINS = {
65 'thecomedynetwork': 'comedy',
66 'discoveryvelocity': 'discvel',
67 'sciencechannel': 'discsci',
68 'investigationdiscovery': 'invdisc',
69 'animalplanet': 'aniplan',
70 'etalk': 'ctv',
71 'bnnbloomberg': 'bnn',
72 'marilyn': 'ctv_marilyn',
73 }
74
75 def _real_extract(self, url):
76 domain, video_id = self._match_valid_url(url).groups()
77 domain = domain.split('.')[0]
78 return {
79 '_type': 'url_transparent',
80 'id': video_id,
81 'url': '9c9media:%s_web:%s' % (self._DOMAINS.get(domain, domain), video_id),
82 'ie_key': 'NineCNineMedia',
83 }