]> jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/breitbart.py
[ie/youtube] Suppress "Unavailable videos are hidden" warning (#10159)
[yt-dlp.git] / yt_dlp / extractor / breitbart.py
1 from .common import InfoExtractor
2
3
4 class BreitBartIE(InfoExtractor):
5 _VALID_URL = r'https?://(?:www\.)?breitbart\.com/videos/v/(?P<id>[^/?#]+)'
6 _TESTS = [{
7 'url': 'https://www.breitbart.com/videos/v/5cOz1yup/?pl=Ij6NDOji',
8 'md5': '0aa6d1d6e183ac5ca09207fe49f17ade',
9 'info_dict': {
10 'id': '5cOz1yup',
11 'ext': 'mp4',
12 'title': 'Watch \u2013 Clyburn: Statues in Congress Have to Go Because they Are Honoring Slavery',
13 'description': 'md5:bac35eb0256d1cb17f517f54c79404d5',
14 'thumbnail': 'https://cdn.jwplayer.com/thumbs/5cOz1yup-1920.jpg',
15 'age_limit': 0,
16 },
17 }, {
18 'url': 'https://www.breitbart.com/videos/v/eaiZjVOn/',
19 'only_matching': True,
20 }]
21
22 def _real_extract(self, url):
23 video_id = self._match_id(url)
24 webpage = self._download_webpage(url, video_id)
25
26 formats = self._extract_m3u8_formats(f'https://cdn.jwplayer.com/manifests/{video_id}.m3u8', video_id, ext='mp4')
27 return {
28 'id': video_id,
29 'title': self._generic_title('', webpage),
30 'description': self._og_search_description(webpage),
31 'thumbnail': self._og_search_thumbnail(webpage),
32 'age_limit': self._rta_search(webpage),
33 'formats': formats,
34 }