]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/arnes.py
[ie/crunchyroll] Fix stream extraction (#10005)
[yt-dlp.git] / yt_dlp / extractor / arnes.py
index c0032fcab972e2192fd479cfa3f671ca83dcc5f1..a493714d1fb2f3108255a7629d49ce5d4c6e36a5 100644 (file)
@@ -1,12 +1,10 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 from .common import InfoExtractor
 from ..compat import (
     compat_parse_qs,
     compat_urllib_parse_urlparse,
 )
 from ..utils import (
+    format_field,
     float_or_none,
     int_or_none,
     parse_iso8601,
@@ -75,7 +73,6 @@ def _real_extract(self, url):
                 'width': int_or_none(media.get('width')),
                 'height': int_or_none(media.get('height')),
             })
-        self._sort_formats(formats)
 
         channel = video.get('channel') or {}
         channel_id = channel.get('url')
@@ -92,7 +89,7 @@ def _real_extract(self, url):
             'timestamp': parse_iso8601(video.get('creationTime')),
             'channel': channel.get('name'),
             'channel_id': channel_id,
-            'channel_url': self._BASE_URL + '/?channel=' + channel_id if channel_id else None,
+            'channel_url': format_field(channel_id, None, f'{self._BASE_URL}/?channel=%s'),
             'duration': float_or_none(video.get('duration'), 1000),
             'view_count': int_or_none(video.get('views')),
             'tags': video.get('hashtags'),