]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/metacafe.py
[extractor] Deprecate `_sort_formats`
[yt-dlp.git] / yt_dlp / extractor / metacafe.py
index 6366028d23360881eadc7297e07d12a561a1feee..d7f5def0e068867c409e3855de2db54a89269f72 100644 (file)
@@ -1,19 +1,14 @@
-from __future__ import unicode_literals
-
 import json
 import re
+import urllib.parse
 
 from .common import InfoExtractor
-from ..compat import (
-    compat_parse_qs,
-    compat_urllib_parse,
-    compat_urllib_parse_unquote,
-)
+from ..compat import compat_parse_qs, compat_urllib_parse_unquote
 from ..utils import (
-    determine_ext,
     ExtractorError,
-    int_or_none,
+    determine_ext,
     get_element_by_attribute,
+    int_or_none,
     mimetype2ext,
 )
 
@@ -130,7 +125,7 @@ def report_disclaimer(self):
 
     def _real_extract(self, url):
         # Extract id and simplified title from URL
-        video_id, display_id = re.match(self._VALID_URL, url).groups()
+        video_id, display_id = self._match_valid_url(url).groups()
 
         # the video may come from an external site
         m_external = re.match(r'^(\w{2})-(.*)$', video_id)
@@ -145,7 +140,7 @@ def _real_extract(self, url):
 
         headers = {
             # Disable family filter
-            'Cookie': 'user=%s; ' % compat_urllib_parse.quote(json.dumps({'ffilter': False}))
+            'Cookie': 'user=%s; ' % urllib.parse.quote(json.dumps({'ffilter': False}))
         }
 
         # AnyClip videos require the flashversion cookie so that we get the link
@@ -272,7 +267,6 @@ def _real_extract(self, url):
                 'url': video_url,
                 'ext': video_ext,
             }]
-        self._sort_formats(formats)
 
         return {
             'id': video_id,