]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/skynewsau.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / skynewsau.py
index 43a9c82cf1544c0e860adc66c67618015248ddc4..617738a7cefaad5c72b971bbeee6fca267a6a2fe 100644 (file)
@@ -22,21 +22,21 @@ class SkyNewsAUIE(InfoExtractor):
             'tags': ['fblink', 'msn', 'usa', 'world', 'yt'],
             'upload_date': '20211015',
         },
-        'params': {'skip_download': True, 'format': 'bv'}
+        'params': {'skip_download': True, 'format': 'bv'},
     }]
 
     _API_KEY = '6krsj3w249nk779d8fukqx9f'
 
     def _real_extract(self, url):
-        id = self._match_id(url)
-        webpage = self._download_webpage(url, id)
+        video_id = self._match_id(url)
+        webpage = self._download_webpage(url, video_id)
         embedcode = self._search_regex(r'embedcode\s?=\s?\"([^\"]+)\"', webpage, 'embedcode')
         data_json = self._download_json(
-            f'https://content.api.news/v3/videos/brightcove/{embedcode}?api_key={self._API_KEY}', id)['content']
+            f'https://content.api.news/v3/videos/brightcove/{embedcode}?api_key={self._API_KEY}', video_id)['content']
         return {
-            'id': id,
+            'id': video_id,
             '_type': 'url_transparent',
-            'url': 'https://players.brightcove.net/%s/default_default/index.html?videoId=%s' % tuple(embedcode.split('-')),
+            'url': 'https://players.brightcove.net/{}/default_default/index.html?videoId={}'.format(*tuple(embedcode.split('-'))),
             'ie_key': 'BrightcoveNew',
             'title': data_json.get('caption'),
             'upload_date': unified_strdate(try_get(data_json, lambda x: x['date']['created'])),