]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/breitbart.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / breitbart.py
CommitLineData
18d6dd4e
G
1from .common import InfoExtractor
2
3
4class BreitBartIE(InfoExtractor):
b634ba74 5 _VALID_URL = r'https?://(?:www\.)?breitbart\.com/videos/v/(?P<id>[^/?#]+)'
18d6dd4e
G
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,
add96eb9 16 },
18d6dd4e
G
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')
18d6dd4e
G
27 return {
28 'id': video_id,
62b8dac4 29 'title': self._generic_title('', webpage),
18d6dd4e
G
30 'description': self._og_search_description(webpage),
31 'thumbnail': self._og_search_thumbnail(webpage),
32 'age_limit': self._rta_search(webpage),
add96eb9 33 'formats': formats,
18d6dd4e 34 }