1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-12 13:28:30 +00:00

[ie/ITVBTCC] Fix extractor (#14161)

Closes #14156
Authored by: garret1317
This commit is contained in:
garret1317 2025-08-28 02:19:25 +01:00 committed by GitHub
parent 223baa81f6
commit 0b51005b48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,6 +18,7 @@
url_or_none, url_or_none,
urljoin, urljoin,
) )
from ..utils.traversal import traverse_obj
class ITVIE(InfoExtractor): class ITVIE(InfoExtractor):
@ -223,6 +224,7 @@ class ITVBTCCIE(InfoExtractor):
}, },
'playlist_count': 12, 'playlist_count': 12,
}, { }, {
# news page, can have absent `data` field
'url': 'https://www.itv.com/news/2021-10-27/i-have-to-protect-the-country-says-rishi-sunak-as-uk-faces-interest-rate-hike', 'url': 'https://www.itv.com/news/2021-10-27/i-have-to-protect-the-country-says-rishi-sunak-as-uk-faces-interest-rate-hike',
'info_dict': { 'info_dict': {
'id': 'i-have-to-protect-the-country-says-rishi-sunak-as-uk-faces-interest-rate-hike', 'id': 'i-have-to-protect-the-country-says-rishi-sunak-as-uk-faces-interest-rate-hike',
@ -243,7 +245,7 @@ def _real_extract(self, url):
entries = [] entries = []
for video in json_map: for video in json_map:
if not any(video['data'].get(attr) == 'Brightcove' for attr in ('name', 'type')): if not any(traverse_obj(video, ('data', attr)) == 'Brightcove' for attr in ('name', 'type')):
continue continue
video_id = video['data']['id'] video_id = video['data']['id']
account_id = video['data']['accountId'] account_id = video['data']['accountId']