X-Git-Url: https://jfr.im/git/yt-dlp.git/blobdiff_plain/db50f19d76c6870a5a13d0cab9287d684fd7449a..add96eb9f84cfffe85682bf2fb85135746994ee8:/yt_dlp/extractor/theweatherchannel.py diff --git a/yt_dlp/extractor/theweatherchannel.py b/yt_dlp/extractor/theweatherchannel.py index d1921e4f9..424f778a2 100644 --- a/yt_dlp/extractor/theweatherchannel.py +++ b/yt_dlp/extractor/theweatherchannel.py @@ -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']