]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/minds.py
[ie/crunchyroll] Fix stream extraction (#10005)
[yt-dlp.git] / yt_dlp / extractor / minds.py
index 9da07207bab71f7b8aafd7ebffeca6beeb38c95d..27a6e380565f1d3a31bae7f28c02f83d3051bfed 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 (
@@ -79,7 +76,7 @@ def _real_extract(self, url):
             else:
                 return self.url_result(entity['perma_url'])
         else:
-            assert(entity['subtype'] == 'video')
+            assert entity['subtype'] == 'video'
             video_id = entity_id
         # 1080p and webm formats available only on the sources array
         video = self._call_api(
@@ -95,7 +92,6 @@ def _real_extract(self, url):
                 'height': int_or_none(source.get('size')),
                 'url': src,
             })
-        self._sort_formats(formats)
 
         entity = video.get('entity') or entity
         owner = entity.get('ownerObj') or {}
@@ -110,7 +106,7 @@ def _real_extract(self, url):
         if poster:
             urlh = self._request_webpage(poster, video_id, fatal=False)
             if urlh:
-                thumbnail = urlh.geturl()
+                thumbnail = urlh.url
 
         return {
             'id': video_id,
@@ -121,7 +117,7 @@ def _real_extract(self, url):
             'timestamp': int_or_none(entity.get('time_created')),
             'uploader': strip_or_none(owner.get('name')),
             'uploader_id': uploader_id,
-            'uploader_url': format_field(uploader_id, template='https://www.minds.com/%s'),
+            'uploader_url': format_field(uploader_id, None, 'https://www.minds.com/%s'),
             'view_count': int_or_none(entity.get('play:count')),
             'like_count': int_or_none(entity.get('thumbs:up:count')),
             'dislike_count': int_or_none(entity.get('thumbs:down:count')),