]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/tvplayer.py
[ie/mlbtv] Fix extraction (#10296)
[yt-dlp.git] / yt_dlp / extractor / tvplayer.py
index 228c2366ed66dcc87abb3852301cf7b5d2af0705..7c47bc78e31316a5448228b18e0f8dd9aaf59247 100644 (file)
@@ -1,11 +1,10 @@
 from .common import InfoExtractor
-from ..compat import compat_str
 from ..networking.exceptions import HTTPError
 from ..utils import (
+    ExtractorError,
     extract_attributes,
     try_get,
     urlencode_postdata,
-    ExtractorError,
 )
 
 
@@ -21,7 +20,7 @@ class TVPlayerIE(InfoExtractor):
         'params': {
             # m3u8 download
             'skip_download': True,
-        }
+        },
     }
 
     def _real_extract(self, url):
@@ -48,7 +47,7 @@ def _real_extract(self, url):
 
         validate = context['validate']
         platform = try_get(
-            context, lambda x: x['platform']['key'], compat_str) or 'firefox'
+            context, lambda x: x['platform']['key'], str) or 'firefox'
 
         try:
             response = self._download_json(
@@ -66,7 +65,7 @@ def _real_extract(self, url):
                 response = self._parse_json(
                     e.cause.response.read().decode(), resource_id)['tvplayer']['response']
                 raise ExtractorError(
-                    '%s said: %s' % (self.IE_NAME, response['error']), expected=True)
+                    '{} said: {}'.format(self.IE_NAME, response['error']), expected=True)
             raise
 
         formats = self._extract_m3u8_formats(response['stream'], display_id, 'mp4')