From 0eedb143424f47a32dbcc1c79341c1082d3f9365 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 30 Aug 2024 23:06:28 +0200 Subject: [PATCH] [ie/Beacon] Inline return statement, validations --- yt_dlp/extractor/beacon.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/yt_dlp/extractor/beacon.py b/yt_dlp/extractor/beacon.py index fe31b8c1d..b9b41d4d2 100644 --- a/yt_dlp/extractor/beacon.py +++ b/yt_dlp/extractor/beacon.py @@ -38,9 +38,12 @@ class BeaconTvIE(InfoExtractor): raise ExtractorError( 'Failed to extract video. Either the given content is not a video, or it requires authentication', expected=True) - info = self._parse_jwplayer_data(traverse_obj(content_data, ('contentVideo', 'video', 'videoData', {json.loads})), video_id) - info['title'] = traverse_obj(content_data, 'title') - info['description'] = traverse_obj(content_data, 'description') - info['timestamp'] = parse_iso8601(traverse_obj(content_data, 'publishedAt')) - - return info + return { + **self._parse_jwplayer_data(traverse_obj( + content_data, ('contentVideo', 'video', 'videoData', {json.loads})), video_id), + **traverse_obj(content_data, { + 'title': ('title', {str}), + 'description': ('description', {str}), + 'timestamp': ('publishedAt', {parse_iso8601}), + }), + }