[ie/Beacon] Inline return statement, validations

This commit is contained in:
Deukhoofd 2024-08-30 23:06:28 +02:00
parent 32dc95c458
commit 0eedb14342
No known key found for this signature in database
GPG Key ID: F63E044490819F6F
1 changed files with 9 additions and 6 deletions

View File

@ -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}),
}),
}