]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/abcotvs.py
[ie/youtube] Suppress "Unavailable videos are hidden" warning (#10159)
[yt-dlp.git] / yt_dlp / extractor / abcotvs.py
index 5bff46634052cbfd330e476a9e8dc9db8414a89d..ea5882b2606d42aa9284b85092ca0d80cbb40539 100644 (file)
@@ -1,9 +1,4 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
-
 from .common import InfoExtractor
-from ..compat import compat_str
 from ..utils import (
     dict_get,
     int_or_none,
@@ -61,11 +56,11 @@ def _real_extract(self, url):
         data = self._download_json(
             'https://api.abcotvs.com/v2/content', display_id, query={
                 'id': video_id,
-                'key': 'otv.web.%s.story' % station,
+                'key': f'otv.web.{station}.story',
                 'station': station,
             })['data']
         video = try_get(data, lambda x: x['featuredMedia']['video'], dict) or data
-        video_id = compat_str(dict_get(video, ('id', 'publishedKey'), video_id))
+        video_id = str(dict_get(video, ('id', 'publishedKey'), video_id))
         title = video.get('title') or video['linkText']
 
         formats = []
@@ -82,7 +77,6 @@ def _real_extract(self, url):
                 'url': mp4_url,
                 'width': 640,
             })
-        self._sort_formats(formats)
 
         image = video.get('image') or {}
 
@@ -123,7 +117,6 @@ def _real_extract(self, url):
         title = video_data['title']
         formats = self._extract_m3u8_formats(
             video_data['videoURL'].split('?')[0], video_id, 'mp4')
-        self._sort_formats(formats)
 
         return {
             'id': video_id,