]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/nuvid.py
[ie/mlbtv] Fix extraction (#10296)
[yt-dlp.git] / yt_dlp / extractor / nuvid.py
index 84fb97d6a32a468ccdee13942645a5a001f8c4fd..99a426b25f4455c8cd3875da8f1dd0c8202a9976 100644 (file)
@@ -1,11 +1,9 @@
-# coding: utf-8
-from __future__ import unicode_literals
 import re
 
 from .common import InfoExtractor
 from ..utils import (
-    parse_duration,
     int_or_none,
+    parse_duration,
     strip_or_none,
     traverse_obj,
     url_or_none,
@@ -24,7 +22,7 @@ class NuvidIE(InfoExtractor):
             'duration': 321.0,
             'age_limit': 18,
             'thumbnail': r're:https?://.+\.jpg',
-        }
+        },
     }, {
         'url': 'https://m.nuvid.com/video/6523263',
         'md5': 'ebd22ce8e47e1d9a4d0756a15c67da52',
@@ -36,7 +34,7 @@ class NuvidIE(InfoExtractor):
             'age_limit': 18,
             'thumbnail': r're:https?://.+\.jpg',
             'thumbnails': list,
-        }
+        },
     }, {
         'url': 'http://m.nuvid.com/video/6415801/',
         'md5': '638d5ececb138d5753593f751ae3f697',
@@ -47,7 +45,7 @@ class NuvidIE(InfoExtractor):
             'duration': 1882,
             'age_limit': 18,
             'thumbnail': r're:https?://.+\.jpg',
-        }
+        },
     }]
 
     def _real_extract(self, url):
@@ -66,7 +64,7 @@ def _real_extract(self, url):
             })
 
         webpage = self._download_webpage(
-            'http://m.nuvid.com/video/%s' % (video_id, ),
+            f'http://m.nuvid.com/video/{video_id}',
             video_id, 'Downloading video page', fatal=False) or ''
 
         title = strip_or_none(video_data.get('title') or self._html_search_regex(
@@ -82,7 +80,6 @@ def _real_extract(self, url):
         } for quality, source in video_data.get('files').items() if source]
 
         self._check_formats(formats, video_id)
-        self._sort_formats(formats)
 
         duration = parse_duration(traverse_obj(video_data, 'duration', 'duration_format'))
         thumbnails = [