]> jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/trunews.py
[ie/youtube] Suppress "Unavailable videos are hidden" warning (#10159)
[yt-dlp.git] / yt_dlp / extractor / trunews.py
1 from .common import InfoExtractor
2
3
4 class TruNewsIE(InfoExtractor):
5 _VALID_URL = r'https?://(?:www\.)?trunews\.com/stream/(?P<id>[^/?#&]+)'
6 _TEST = {
7 'url': 'https://www.trunews.com/stream/will-democrats-stage-a-circus-during-president-trump-s-state-of-the-union-speech',
8 'info_dict': {
9 'id': '5c5a21e65d3c196e1c0020cc',
10 'display_id': 'will-democrats-stage-a-circus-during-president-trump-s-state-of-the-union-speech',
11 'ext': 'mp4',
12 'title': "Will Democrats Stage a Circus During President Trump's State of the Union Speech?",
13 'description': 'md5:c583b72147cc92cf21f56a31aff7a670',
14 'duration': 3685,
15 'timestamp': 1549411440,
16 'upload_date': '20190206',
17 },
18 'add_ie': ['Zype'],
19 }
20 _ZYPE_TEMPL = 'https://player.zype.com/embed/%s.js?api_key=X5XnahkjCwJrT_l5zUqypnaLEObotyvtUKJWWlONxDoHVjP8vqxlArLV8llxMbyt'
21
22 def _real_extract(self, url):
23 display_id = self._match_id(url)
24
25 zype_id = self._download_json(
26 'https://api.zype.com/videos', display_id, query={
27 'app_key': 'PUVKp9WgGUb3-JUw6EqafLx8tFVP6VKZTWbUOR-HOm__g4fNDt1bCsm_LgYf_k9H',
28 'per_page': 1,
29 'active': 'true',
30 'friendly_title': display_id,
31 })['response'][0]['_id']
32 return self.url_result(self._ZYPE_TEMPL % zype_id, 'Zype', zype_id)