]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/breitbart.py
[ie/matchtv] Fix extractor (#10190)
[yt-dlp.git] / yt_dlp / extractor / breitbart.py
index e029aa627fac5f9f8b0886c90b6034c3d21f14f8..fedf4772a97488b1258731a13addc6638352fece 100644 (file)
@@ -1,10 +1,8 @@
-from __future__ import unicode_literals
-
 from .common import InfoExtractor
 
 
 class BreitBartIE(InfoExtractor):
-    _VALID_URL = r'https?:\/\/(?:www\.)breitbart.com/videos/v/(?P<id>[^/]+)'
+    _VALID_URL = r'https?://(?:www\.)?breitbart\.com/videos/v/(?P<id>[^/?#]+)'
     _TESTS = [{
         'url': 'https://www.breitbart.com/videos/v/5cOz1yup/?pl=Ij6NDOji',
         'md5': '0aa6d1d6e183ac5ca09207fe49f17ade',
@@ -15,7 +13,7 @@ class BreitBartIE(InfoExtractor):
             '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,
@@ -26,13 +24,11 @@ def _real_extract(self, 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_extract_title(webpage, 'video title')),
+            'title': self._generic_title('', webpage),
             'description': self._og_search_description(webpage),
             'thumbnail': self._og_search_thumbnail(webpage),
             'age_limit': self._rta_search(webpage),
-            'formats': formats
+            'formats': formats,
         }