]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/hitbox.py
[extractor] Deprecate `_sort_formats`
[yt-dlp.git] / yt_dlp / extractor / hitbox.py
index 3e5ff2685e0cea5f57ffbbebbe8a8129767358f5..f0c689883681bbc0dadde05463611c009dc0b729 100644 (file)
@@ -1,16 +1,13 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 import re
 
 from .common import InfoExtractor
+from ..compat import compat_str
 from ..utils import (
     clean_html,
-    parse_iso8601,
+    determine_ext,
     float_or_none,
     int_or_none,
-    compat_str,
-    determine_ext,
+    parse_iso8601,
 )
 
 
@@ -121,7 +118,6 @@ def _real_extract(self, url):
                     'tbr': bitrate,
                     'format_note': label,
                 })
-        self._sort_formats(formats)
 
         metadata = self._extract_metadata(
             'https://www.smashcast.tv/api/media/video', video_id)
@@ -130,7 +126,7 @@ def _real_extract(self, url):
         return metadata
 
 
-class HitboxLiveIE(HitboxIE):
+class HitboxLiveIE(HitboxIE):  # XXX: Do not subclass from concrete IE
     IE_NAME = 'hitbox:live'
     _VALID_URL = r'https?://(?:www\.)?(?:hitbox|smashcast)\.tv/(?P<id>[^/?#&]+)'
     _TESTS = [{
@@ -203,12 +199,11 @@ def _real_extract(self, url):
                             'page_url': url,
                             'player_url': 'http://www.hitbox.tv/static/player/flowplayer/flowplayer.commercial-3.2.16.swf',
                         })
-        self._sort_formats(formats)
 
         metadata = self._extract_metadata(
             'https://www.smashcast.tv/api/media/live', video_id)
         metadata['formats'] = formats
         metadata['is_live'] = True
-        metadata['title'] = self._live_title(metadata.get('title'))
+        metadata['title'] = metadata.get('title')
 
         return metadata