]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/joj.py
[extractor] Deprecate `_sort_formats`
[yt-dlp.git] / yt_dlp / extractor / joj.py
index 7350f537c6c9432f15cc0067388946de417835d6..9b622845a7fc760a22a52a8e050878ddac03ef1f 100644 (file)
@@ -1,8 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
-import re
-
 from .common import InfoExtractor
 from ..compat import compat_str
 from ..utils import (
@@ -21,6 +16,7 @@ class JojIE(InfoExtractor):
                     )
                     (?P<id>[^/?#^]+)
                 '''
+    _EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//media\.joj\.sk/embed/(?:(?!\1).)+)\1']
     _TESTS = [{
         'url': 'https://media.joj.sk/embed/a388ec4c-6019-4a4a-9312-b1bee194e932',
         'info_dict': {
@@ -41,14 +37,6 @@ class JojIE(InfoExtractor):
         'only_matching': True,
     }]
 
-    @staticmethod
-    def _extract_urls(webpage):
-        return [
-            mobj.group('url')
-            for mobj in re.finditer(
-                r'<iframe\b[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//media\.joj\.sk/embed/(?:(?!\1).)+)\1',
-                webpage)]
-
     def _real_extract(self, url):
         video_id = self._match_id(url)
 
@@ -73,7 +61,7 @@ def _real_extract(self, url):
                     r'(\d+)[pP]\.', format_url, 'height', default=None)
                 formats.append({
                     'url': format_url,
-                    'format_id': format_field(height, template='%sp'),
+                    'format_id': format_field(height, None, '%sp'),
                     'height': int(height),
                 })
         if not formats:
@@ -93,7 +81,6 @@ def _real_extract(self, url):
                         r'(\d+)[pP]', format_id or path, 'height',
                         default=None)),
                 })
-        self._sort_formats(formats)
 
         thumbnail = self._og_search_thumbnail(webpage)