]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/lnkgo.py
[ie/crunchyroll] Fix stream extraction (#10005)
[yt-dlp.git] / yt_dlp / extractor / lnkgo.py
index 7da0b4284b21a111f87f4a173d3406e785cb14ac..6282d2eaf3f1de2536686bd6b336968a00b3302c 100644 (file)
@@ -1,11 +1,7 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
-
 from .common import InfoExtractor
+from ..compat import compat_str
 from ..utils import (
     clean_html,
-    compat_str,
     format_field,
     int_or_none,
     parse_iso8601,
@@ -71,16 +67,13 @@ def _real_extract(self, url):
         formats = self._extract_m3u8_formats(
             self._M3U8_TEMPL % (prefix, video_info['videoUrl'], video_info.get('secureTokenParams') or ''),
             video_id, 'mp4', 'm3u8_native')
-        self._sort_formats(formats)
-
-        poster_image = video_info.get('posterImage')
 
         return {
             'id': video_id,
             'display_id': display_id,
             'title': title,
             'formats': formats,
-            'thumbnail': 'https://lnk.lt/all-images/' + poster_image if poster_image else None,
+            'thumbnail': format_field(video_info, 'posterImage', 'https://lnk.lt/all-images/%s'),
             'duration': int_or_none(video_info.get('duration')),
             'description': clean_html(video_info.get('htmlDescription')),
             'age_limit': self._AGE_LIMITS.get(video_info.get('pgRating'), 0),
@@ -155,7 +148,6 @@ def _real_extract(self, url):
             formats.extend(fmts)
             subtitles = self._merge_subtitles(subtitles, subs)
 
-        self._sort_formats(formats)
         return {
             'id': id,
             'title': video_json.get('title'),