]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/seznamzpravy.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / seznamzpravy.py
index b31d566dfe444096240fa0a0fcf6be7d72943c25..6f2bfcd27f513bdea98c2e97c3c7060b0c09d093 100644 (file)
@@ -1,8 +1,6 @@
+import urllib.parse
+
 from .common import InfoExtractor
-from ..compat import (
-    compat_str,
-    compat_urllib_parse_urlparse,
-)
 from ..utils import (
     int_or_none,
     parse_codecs,
@@ -13,7 +11,7 @@
 
 
 def _raw_id(src_url):
-    return compat_urllib_parse_urlparse(src_url).path.split('/')[-1]
+    return urllib.parse.urlparse(src_url).path.split('/')[-1]
 
 
 class SeznamZpravyIE(InfoExtractor):
@@ -68,7 +66,7 @@ def _extract_sdn_formats(self, sdn_url, video_id):
 
             f = {
                 'url': urljoin(sdn_url, relative_url),
-                'format_id': 'http-%s' % format_id,
+                'format_id': f'http-{format_id}',
                 'tbr': int_or_none(format_data.get('bandwidth'), scale=1000),
                 'width': int_or_none(width),
                 'height': int_or_none(height),
@@ -79,7 +77,7 @@ def _extract_sdn_formats(self, sdn_url, video_id):
         pls = sdn_data.get('pls', {})
 
         def get_url(format_id):
-            return try_get(pls, lambda x: x[format_id]['url'], compat_str)
+            return try_get(pls, lambda x: x[format_id]['url'], str)
 
         dash_rel_url = get_url('dash')
         if dash_rel_url: