]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/ustudio.py
[misc] Add `hatch`, `ruff`, `pre-commit` and improve dev docs (#7409)
[yt-dlp.git] / yt_dlp / extractor / ustudio.py
index 56509beedc027ae9eae3f3f36d91be32238d729a..f6ce5b3577d7b929653e6dec493fd153ff04d97f 100644 (file)
@@ -1,12 +1,8 @@
-from __future__ import unicode_literals
-
-import re
-
 from .common import InfoExtractor
 from ..utils import (
     int_or_none,
-    unified_strdate,
     unescapeHTML,
+    unified_strdate,
 )
 
 
@@ -29,7 +25,7 @@ class UstudioIE(InfoExtractor):
     }
 
     def _real_extract(self, url):
-        video_id, display_id = re.match(self._VALID_URL, url).groups()
+        video_id, display_id = self._match_valid_url(url).groups()
 
         config = self._download_xml(
             'http://v1.ustudio.com/embed/%s/ustudio/config.xml' % video_id,
@@ -43,7 +39,6 @@ def extract(kind):
             } for item in config.findall('./qualities/quality/%s' % kind) if item.get('url')]
 
         formats = extract('video')
-        self._sort_formats(formats)
 
         webpage = self._download_webpage(url, display_id)
 
@@ -83,7 +78,7 @@ class UstudioEmbedIE(InfoExtractor):
     }
 
     def _real_extract(self, url):
-        uploader_id, video_id = re.match(self._VALID_URL, url).groups()
+        uploader_id, video_id = self._match_valid_url(url).groups()
         video_data = self._download_json(
             'http://app.ustudio.com/embed/%s/%s/config.json' % (uploader_id, video_id),
             video_id)['videos'][0]
@@ -102,7 +97,6 @@ def _real_extract(self, url):
                     'width': int_or_none(quality.get('width')),
                     'height': height,
                 })
-        self._sort_formats(formats)
 
         thumbnails = []
         for image in video_data.get('images', []):