]>
Commit | Line | Data |
---|---|---|
2fac2e91 AG |
1 | from __future__ import unicode_literals |
2 | ||
3 | ||
4 | from .common import InfoExtractor | |
5 | ||
6 | ||
7 | class MediaiteIE(InfoExtractor): | |
8 | _VALID_URL = r'https?://(?:www\.)?mediaite.com/(?:tv|sports|politics|podcasts|opinion)/[\w-]+/' | |
9 | _TESTS = [{ | |
10 | '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/', | |
11 | 'info_dict': { | |
12 | 'id': 'vPHKITzy', | |
13 | 'ext': 'm4a', | |
14 | 'title': 'Bill Burr On NFL And Black Lives Matter', | |
15 | 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e', | |
16 | 'thumbnail': 'https://cdn.jwplayer.com/v2/media/vPHKITzy/poster.jpg?width=720', | |
17 | 'duration': 55, | |
18 | 'timestamp': 1631630185, | |
19 | 'upload_date': '20210914', | |
20 | }, | |
21 | 'params': {'skip_download': True} | |
22 | }, { | |
23 | 'url': 'https://www.mediaite.com/tv/joe-scarborough-goes-off-on-tax-breaks-for-super-wealthy-largest-income-redistribution-scam-in-american-history/', | |
24 | 'info_dict': { | |
25 | 'id': 'eeFcK4Xm', | |
26 | 'ext': 'mp4', | |
27 | 'title': 'Morning Joe-6_16_52 am - 6_21_10 am-2021-09-14.mp4', | |
28 | 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e', | |
29 | 'thumbnail': 'https://cdn.jwplayer.com/v2/media/eeFcK4Xm/poster.jpg?width=720', | |
30 | 'duration': 258, | |
31 | 'timestamp': 1631618057, | |
32 | 'upload_date': '20210914', | |
33 | }, | |
34 | 'params': {'skip_download': True} | |
35 | }, { | |
36 | 'url': 'https://www.mediaite.com/politics/watch-rudy-giuliani-impersonates-queen-elizabeth-calls-mark-milley-an-asshle-in-bizarre-9-11-speech/', | |
37 | 'info_dict': { | |
38 | 'id': 'EiyiXKcr', | |
39 | 'ext': 'mp4', | |
40 | 'title': 'Giuliani 1', | |
41 | 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e', | |
42 | 'thumbnail': 'https://cdn.jwplayer.com/v2/media/EiyiXKcr/poster.jpg?width=720', | |
43 | 'duration': 39, | |
44 | 'timestamp': 1631536476, | |
45 | 'upload_date': '20210913', | |
46 | }, | |
47 | 'params': {'skip_download': True} | |
48 | }, { | |
49 | 'url': 'https://www.mediaite.com/podcasts/clarissa-ward-says-she-decided-to-become-a-journalist-on-9-11/', | |
50 | 'info_dict': { | |
51 | 'id': 'TxavoRTx', | |
52 | 'ext': 'mp4', | |
53 | 'title': 'clarissa-ward-3.mp4', | |
54 | 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e', | |
55 | 'thumbnail': 'https://cdn.jwplayer.com/v2/media/TxavoRTx/poster.jpg?width=720', | |
56 | 'duration': 83, | |
57 | 'timestamp': 1631311188, | |
58 | 'upload_date': '20210910', | |
59 | }, | |
60 | 'params': {'skip_download': True} | |
61 | }, { | |
62 | 'url': 'https://www.mediaite.com/opinion/mainstream-media-ignores-rose-mcgowans-bombshell-allegation-that-newsoms-wife-tried-to-silence-her-on-weinstein/', | |
63 | 'info_dict': { | |
64 | 'id': 'sEIWvKR7', | |
65 | 'ext': 'mp4', | |
66 | 'title': 'KTTV_09-13-2021_05.34.21', | |
67 | 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e', | |
68 | 'thumbnail': 'https://cdn.jwplayer.com/v2/media/sEIWvKR7/poster.jpg?width=720', | |
69 | 'duration': 52, | |
70 | 'timestamp': 1631553328, | |
71 | 'upload_date': '20210913', | |
72 | }, | |
73 | 'params': {'skip_download': True} | |
74 | }] | |
75 | ||
76 | def _real_extract(self, url): | |
77 | webpage = self._download_webpage(url, None) | |
78 | id = self._search_regex(r'data-video-id\s?=\s?\"([^\"]+)\"', webpage, 'id') | |
79 | data_json = self._download_json(f'https://cdn.jwplayer.com/v2/media/{id}', id) | |
80 | return self._parse_jwplayer_data(data_json) |