]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/mediaite.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / mediaite.py
CommitLineData
2fac2e91
AG
1from .common import InfoExtractor
2
3
4class MediaiteIE(InfoExtractor):
b634ba74 5 _VALID_URL = r'https?://(?:www\.)?mediaite\.com(?!/category)(?:/[\w-]+){2}'
2fac2e91
AG
6 _TESTS = [{
7 'url': 'https://www.mediaite.com/sports/bill-burr-roasts-nfl-for-promoting-black-lives-matter-while-scheduling-more-games-after-all-the-sht-they-know-about-cte/',
8 'info_dict': {
9 'id': 'vPHKITzy',
10 'ext': 'm4a',
11 'title': 'Bill Burr On NFL And Black Lives Matter',
12 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
13 'thumbnail': 'https://cdn.jwplayer.com/v2/media/vPHKITzy/poster.jpg?width=720',
14 'duration': 55,
15 'timestamp': 1631630185,
16 'upload_date': '20210914',
17 },
add96eb9 18 'params': {'skip_download': True},
2fac2e91
AG
19 }, {
20 'url': 'https://www.mediaite.com/tv/joe-scarborough-goes-off-on-tax-breaks-for-super-wealthy-largest-income-redistribution-scam-in-american-history/',
21 'info_dict': {
22 'id': 'eeFcK4Xm',
23 'ext': 'mp4',
24 'title': 'Morning Joe-6_16_52 am - 6_21_10 am-2021-09-14.mp4',
25 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
26 'thumbnail': 'https://cdn.jwplayer.com/v2/media/eeFcK4Xm/poster.jpg?width=720',
27 'duration': 258,
28 'timestamp': 1631618057,
29 'upload_date': '20210914',
30 },
add96eb9 31 'params': {'skip_download': True},
2fac2e91
AG
32 }, {
33 'url': 'https://www.mediaite.com/politics/watch-rudy-giuliani-impersonates-queen-elizabeth-calls-mark-milley-an-asshle-in-bizarre-9-11-speech/',
34 'info_dict': {
35 'id': 'EiyiXKcr',
36 'ext': 'mp4',
37 'title': 'Giuliani 1',
38 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
39 'thumbnail': 'https://cdn.jwplayer.com/v2/media/EiyiXKcr/poster.jpg?width=720',
40 'duration': 39,
41 'timestamp': 1631536476,
42 'upload_date': '20210913',
43 },
add96eb9 44 'params': {'skip_download': True},
2fac2e91
AG
45 }, {
46 'url': 'https://www.mediaite.com/podcasts/clarissa-ward-says-she-decided-to-become-a-journalist-on-9-11/',
47 'info_dict': {
48 'id': 'TxavoRTx',
49 'ext': 'mp4',
50 'title': 'clarissa-ward-3.mp4',
51 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
52 'thumbnail': 'https://cdn.jwplayer.com/v2/media/TxavoRTx/poster.jpg?width=720',
53 'duration': 83,
54 'timestamp': 1631311188,
55 'upload_date': '20210910',
56 },
add96eb9 57 'params': {'skip_download': True},
2fac2e91
AG
58 }, {
59 'url': 'https://www.mediaite.com/opinion/mainstream-media-ignores-rose-mcgowans-bombshell-allegation-that-newsoms-wife-tried-to-silence-her-on-weinstein/',
60 'info_dict': {
61 'id': 'sEIWvKR7',
62 'ext': 'mp4',
63 'title': 'KTTV_09-13-2021_05.34.21',
64 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
65 'thumbnail': 'https://cdn.jwplayer.com/v2/media/sEIWvKR7/poster.jpg?width=720',
66 'duration': 52,
67 'timestamp': 1631553328,
68 'upload_date': '20210913',
69 },
add96eb9 70 'params': {'skip_download': True},
762e509d 71 }, {
72 'url': 'https://www.mediaite.com/news/watch-cnbcs-jim-cramer-says-nobody-wants-to-die-getting-infected-by-unvaccinated-coworker-even-for-22-an-hour/',
73 'info_dict': {
74 'id': 'nwpt1elX',
75 'ext': 'mp4',
76 'title': "CNBC's Jim Cramer Says Nobody Wants to Die Getting Infected by Unvaccinated Coworker 'Even for $22 an Hour'.mp4",
77 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
78 'thumbnail': 'https://cdn.jwplayer.com/v2/media/nwpt1elX/poster.jpg?width=720',
79 'duration': 60,
80 'timestamp': 1633014214,
81 'upload_date': '20210930',
82 },
add96eb9 83 'params': {'skip_download': True},
630a55df
G
84 }, {
85 'url': 'https://www.mediaite.com/politics/i-cant-read-it-fast-enough-while-defending-trump-larry-kudlow-overwhelmed-by-volume-of-ex-presidents-legal-troubles/',
86 'info_dict': {
87 'id': 'E6EhDX5z',
88 'ext': 'mp4',
89 'title': 'Fox Business Network - 4:00 PM - 5:00 PM - 1:39:42 pm - 1:42:20 pm',
90 'description': '',
91 'thumbnail': 'https://cdn.jwplayer.com/v2/media/E6EhDX5z/poster.jpg?width=720',
92 'duration': 157,
93 'timestamp': 1691015535,
94 'upload_date': '20230802',
95 },
add96eb9 96 'params': {'skip_download': True},
2fac2e91
AG
97 }]
98
99 def _real_extract(self, url):
100 webpage = self._download_webpage(url, None)
630a55df
G
101 video_id = self._search_regex(
102 [r'"https://cdn\.jwplayer\.com/players/(\w+)', r'data-video-id\s*=\s*\"([^\"]+)\"'], webpage, 'id')
103 data_json = self._download_json(f'https://cdn.jwplayer.com/v2/media/{video_id}', video_id)
2fac2e91 104 return self._parse_jwplayer_data(data_json)