aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/breitbart.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-11-27 13:25:01 -0500
committerJesús <heckyel@hyperbola.info>2021-11-27 13:25:01 -0500
commitc6df1db4745c9d399204876bbe04e8a311c01df1 (patch)
treea9f4ffa1db45e367aba1de858ac536b761f192fb /yt_dlp/extractor/breitbart.py
parent5bb25093eb718346ab8a723d2c04f0066fc3958a (diff)
parent93e597ba287539643851f0ad5c5ff04760380268 (diff)
downloadhypervideo-pre-c6df1db4745c9d399204876bbe04e8a311c01df1.tar.lz
hypervideo-pre-c6df1db4745c9d399204876bbe04e8a311c01df1.tar.xz
hypervideo-pre-c6df1db4745c9d399204876bbe04e8a311c01df1.zip
updated from upstream | 27/11/2021 at 13:25
Diffstat (limited to 'yt_dlp/extractor/breitbart.py')
-rw-r--r--yt_dlp/extractor/breitbart.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/yt_dlp/extractor/breitbart.py b/yt_dlp/extractor/breitbart.py
new file mode 100644
index 000000000..f50f719dc
--- /dev/null
+++ b/yt_dlp/extractor/breitbart.py
@@ -0,0 +1,39 @@
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class BreitBartIE(InfoExtractor):
+ _VALID_URL = r'https?:\/\/(?:www\.)breitbart.com/videos/v/(?P<id>[^/]+)'
+ _TESTS = [{
+ 'url': 'https://www.breitbart.com/videos/v/5cOz1yup/?pl=Ij6NDOji',
+ 'md5': '0aa6d1d6e183ac5ca09207fe49f17ade',
+ 'info_dict': {
+ 'id': '5cOz1yup',
+ 'ext': 'mp4',
+ 'title': 'Watch \u2013 Clyburn: Statues in Congress Have to Go Because they Are Honoring Slavery',
+ 'description': 'md5:bac35eb0256d1cb17f517f54c79404d5',
+ 'thumbnail': 'https://cdn.jwplayer.com/thumbs/5cOz1yup-1920.jpg',
+ 'age_limit': 0,
+ }
+ }, {
+ 'url': 'https://www.breitbart.com/videos/v/eaiZjVOn/',
+ 'only_matching': True,
+ }]
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+ webpage = self._download_webpage(url, video_id)
+
+ formats = self._extract_m3u8_formats(f'https://cdn.jwplayer.com/manifests/{video_id}.m3u8', video_id, ext='mp4')
+ self._sort_formats(formats)
+ return {
+ 'id': video_id,
+ 'title': self._og_search_title(
+ webpage, default=None) or self._html_search_regex(
+ r'(?s)<title>(.*?)</title>', webpage, 'video title'),
+ 'description': self._og_search_description(webpage),
+ 'thumbnail': self._og_search_thumbnail(webpage),
+ 'age_limit': self._rta_search(webpage),
+ 'formats': formats
+ }