]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/c56.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / c56.py
index cac8fdcba4a9967b9aa028c29bac1d539af458ca..6264803dd683c2a4a340174ddc5e584effec9130 100644 (file)
@@ -1,8 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
-import re
-
 from .common import InfoExtractor
 from ..utils import js_to_json
 
@@ -31,7 +26,7 @@ class C56IE(InfoExtractor):
     }]
 
     def _real_extract(self, url):
-        mobj = re.match(self._VALID_URL, url, flags=re.VERBOSE)
+        mobj = self._match_valid_url(url)
         text_id = mobj.group('textid')
 
         webpage = self._download_webpage(url, text_id)
@@ -43,7 +38,7 @@ def _real_extract(self, url):
             return self.url_result(sohu_video_info['url'], 'Sohu')
 
         page = self._download_json(
-            'http://vxml.56.com/json/%s/' % text_id, text_id, 'Downloading video info')
+            f'http://vxml.56.com/json/{text_id}/', text_id, 'Downloading video info')
 
         info = page['info']
 
@@ -51,10 +46,9 @@ def _real_extract(self, url):
             {
                 'format_id': f['type'],
                 'filesize': int(f['filesize']),
-                'url': f['url']
+                'url': f['url'],
             } for f in info['rfiles']
         ]
-        self._sort_formats(formats)
 
         return {
             'id': info['vid'],