]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/theweatherchannel.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / theweatherchannel.py
index d1921e4f9a835215902125978ce0dbc94ad11914..424f778a27ba99f2ef80b5a78ea71533229bed1a 100644 (file)
@@ -24,7 +24,7 @@ class TheWeatherChannelIE(ThePlatformIE):  # XXX: Do not subclass from concrete
             'timestamp': 1689967343,
             'display_id': 'invest-95l-in-atlantic-has-a-medium-chance-of-development',
             'duration': 34.0,
-        }
+        },
     }, {
         'url': 'https://weather.com/en-CA/international/videos/video/unidentified-object-falls-from-sky-in-india',
         'only_matching': True,
@@ -34,7 +34,7 @@ def _real_extract(self, url):
         asset_name, locale, display_id = self._match_valid_url(url).groups()
         if not locale:
             locale = 'en-US'
-        video_data = list(self._download_json(
+        video_data = next(iter(self._download_json(
             'https://weather.com/api/v1/p/redux-dal', display_id, data=json.dumps([{
                 'name': 'getCMSAssetsUrlConfig',
                 'params': {
@@ -44,10 +44,10 @@ def _real_extract(self, url):
                             '$in': asset_name,
                         },
                     },
-                }
+                },
             }]).encode(), headers={
                 'Content-Type': 'application/json',
-            })['dal']['getCMSAssetsUrlConfig'].values())[0]['data'][0]
+            })['dal']['getCMSAssetsUrlConfig'].values()))['data'][0]
         video_id = video_data['id']
         seo_meta = video_data.get('seometa', {})
         title = video_data.get('title') or seo_meta['title']