]>
Commit | Line | Data |
---|---|---|
18d6dd4e G |
1 | from __future__ import unicode_literals |
2 | ||
3 | from .common import InfoExtractor | |
4 | ||
5 | ||
6 | class BreitBartIE(InfoExtractor): | |
7 | _VALID_URL = r'https?:\/\/(?:www\.)breitbart.com/videos/v/(?P<id>[^/]+)' | |
8 | _TESTS = [{ | |
9 | 'url': 'https://www.breitbart.com/videos/v/5cOz1yup/?pl=Ij6NDOji', | |
10 | 'md5': '0aa6d1d6e183ac5ca09207fe49f17ade', | |
11 | 'info_dict': { | |
12 | 'id': '5cOz1yup', | |
13 | 'ext': 'mp4', | |
14 | 'title': 'Watch \u2013 Clyburn: Statues in Congress Have to Go Because they Are Honoring Slavery', | |
15 | 'description': 'md5:bac35eb0256d1cb17f517f54c79404d5', | |
16 | 'thumbnail': 'https://cdn.jwplayer.com/thumbs/5cOz1yup-1920.jpg', | |
17 | 'age_limit': 0, | |
18 | } | |
19 | }, { | |
20 | 'url': 'https://www.breitbart.com/videos/v/eaiZjVOn/', | |
21 | 'only_matching': True, | |
22 | }] | |
23 | ||
24 | def _real_extract(self, url): | |
25 | video_id = self._match_id(url) | |
26 | webpage = self._download_webpage(url, video_id) | |
27 | ||
28 | formats = self._extract_m3u8_formats(f'https://cdn.jwplayer.com/manifests/{video_id}.m3u8', video_id, ext='mp4') | |
29 | self._sort_formats(formats) | |
30 | return { | |
31 | 'id': video_id, | |
04f3fd2c | 32 | 'title': (self._og_search_title(webpage, default=None) |
33 | or self._html_extract_title(webpage, 'video title')), | |
18d6dd4e G |
34 | 'description': self._og_search_description(webpage), |
35 | 'thumbnail': self._og_search_thumbnail(webpage), | |
36 | 'age_limit': self._rta_search(webpage), | |
37 | 'formats': formats | |
38 | } |