mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[ie/Beacon] Inline return statement, validations
This commit is contained in:
parent
32dc95c458
commit
0eedb14342
1 changed files with 9 additions and 6 deletions
|
@ -38,9 +38,12 @@ def _real_extract(self, url):
|
|||
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}),
|
||||
}),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue