]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/cpac.py
[ie/crunchyroll] Fix stream extraction (#10005)
[yt-dlp.git] / yt_dlp / extractor / cpac.py
index 22741152c643a903effd410f2d22259191a86b66..32bba1e5a96813afbd7f124e613d9fdce268e2c3 100644 (file)
@@ -1,6 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 from .common import InfoExtractor
 from ..compat import compat_str
 from ..utils import (
@@ -12,13 +9,6 @@
     urljoin,
 )
 
-# compat_range
-try:
-    if callable(xrange):
-        range = xrange
-except (NameError, TypeError):
-    pass
-
 
 class CPACIE(InfoExtractor):
     IE_NAME = 'cpac'
@@ -64,8 +54,6 @@ def _real_extract(self, url):
                 else:
                     fmt['language_preference'] = -10
 
-        self._sort_formats(formats)
-
         category = str_or_none(content['details']['category_%s_t' % (url_lang, )])
 
         def is_live(v_type):
@@ -77,7 +65,7 @@ def is_live(v_type):
             'title': title,
             'description': str_or_none(content['details'].get('description_%s_t' % (url_lang, ))),
             'timestamp': unified_timestamp(content['details'].get('liveDateTime')),
-            'category': [category] if category else None,
+            'categories': [category] if category else None,
             'thumbnail': urljoin(url, str_or_none(content['details'].get('image_%s_s' % (url_lang, )))),
             'is_live': is_live(content['details'].get('type')),
         }