]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/limelight.py
[ie/crunchyroll] Fix stream extraction (#10005)
[yt-dlp.git] / yt_dlp / extractor / limelight.py
index 90065094b60006641d72bffdc28f6ffea8d005b3..4e50f106f97457c9c629ca7d7a76ec8ec43c0519 100644 (file)
@@ -1,7 +1,7 @@
 import re
 
 from .common import InfoExtractor
-from ..compat import compat_HTTPError
+from ..networking.exceptions import HTTPError
 from ..utils import (
     determine_ext,
     float_or_none,
@@ -69,8 +69,8 @@ def _call_playlist_service(self, item_id, method, fatal=True, referer=None):
                 item_id, 'Downloading PlaylistService %s JSON' % method,
                 fatal=fatal, headers=headers)
         except ExtractorError as e:
-            if isinstance(e.cause, compat_HTTPError) and e.cause.code == 403:
-                error = self._parse_json(e.cause.read().decode(), item_id)['detail']['contentAccessPermission']
+            if isinstance(e.cause, HTTPError) and e.cause.status == 403:
+                error = self._parse_json(e.cause.response.read().decode(), item_id)['detail']['contentAccessPermission']
                 if error == 'CountryDisabled':
                     self.raise_geo_restricted()
                 raise ExtractorError(error, expected=True)
@@ -179,8 +179,6 @@ def _extract_info(self, pc, mobile, i, referer):
                     'ext': ext,
                 })
 
-        self._sort_formats(formats)
-
         subtitles = {}
         for flag in mobile_item.get('flags'):
             if flag == 'ClosedCaptions':