]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/mdr.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / mdr.py
index 3ca174c2b9cbc99780479b9a4b9a3ed2a9a26fb6..46097fa20e0abaac9329e8c3b3af6513c2cc41ef 100644 (file)
@@ -1,8 +1,6 @@
-# coding: utf-8
-from __future__ import unicode_literals
+import urllib.parse
 
 from .common import InfoExtractor
-from ..compat import compat_urlparse
 from ..utils import (
     determine_ext,
     int_or_none,
@@ -107,7 +105,7 @@ def _real_extract(self, url):
             webpage, 'data url', group='url').replace(r'\/', '/')
 
         doc = self._download_xml(
-            compat_urlparse.urljoin(url, data_url), video_id)
+            urllib.parse.urljoin(url, data_url), video_id)
 
         title = xpath_text(doc, ['./title', './broadcast/broadcastName'], 'title', fatal=True)
 
@@ -121,7 +119,7 @@ def _real_extract(self, url):
                     'progressiveDownload',
                     'dynamicHttpStreamingRedirector',
                     'adaptiveHttpStreamingRedirector'):
-                url_el = asset.find('./%sUrl' % source)
+                url_el = asset.find(f'./{source}Url')
                 if url_el is None:
                     continue
 
@@ -165,8 +163,6 @@ def _real_extract(self, url):
 
                     formats.append(f)
 
-        self._sort_formats(formats)
-
         description = xpath_text(doc, './broadcast/broadcastDescription', 'description')
         timestamp = parse_iso8601(
             xpath_text(