]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/hketv.py
[ie/matchtv] Fix extractor (#10190)
[yt-dlp.git] / yt_dlp / extractor / hketv.py
index 4c616d1ddc8bc4e89327fb269a9579a1fd4c3507..bffb6afe02700d60ae7bae7fc6774cad5ba06bdd 100644 (file)
@@ -1,8 +1,7 @@
 from .common import InfoExtractor
-from ..compat import compat_str
 from ..utils import (
-    clean_html,
     ExtractorError,
+    clean_html,
     int_or_none,
     merge_dicts,
     parse_count,
@@ -126,7 +125,7 @@ def _real_extract(self, url):
             # If we ever wanted to provide the final resolved URL that
             # does not require cookies, albeit with a shorter lifespan:
             #     urlh = self._downloader.urlopen(file_url)
-            #     resolved_url = urlh.geturl()
+            #     resolved_url = urlh.url
             label = fmt.get('label')
             h = self._FORMAT_HEIGHTS.get(label)
             w = h * width // height if h and width and height else None
@@ -137,7 +136,6 @@ def _real_extract(self, url):
                 'width': w,
                 'height': h,
             })
-        self._sort_formats(formats)
 
         subtitles = {}
         tracks = try_get(playlist0, lambda x: x['tracks'], list) or []
@@ -145,7 +143,7 @@ def _real_extract(self, url):
             if not isinstance(track, dict):
                 continue
             track_kind = str_or_none(track.get('kind'))
-            if not track_kind or not isinstance(track_kind, compat_str):
+            if not track_kind or not isinstance(track_kind, str):
                 continue
             if track_kind.lower() not in ('captions', 'subtitles'):
                 continue