[ie/vimeo] Extract live_status and release_timestamp (#9290)

Authored by: pzhlkj6612
This commit is contained in:
Mozi 2024-03-02 00:41:32 +00:00 committed by GitHub
parent d9b4154cbc
commit f0426e9ca5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,6 +21,7 @@
parse_qs,
smuggle_url,
str_or_none,
traverse_obj,
try_get,
unified_timestamp,
unsmuggle_url,
@ -121,7 +122,13 @@ def _parse_config(self, config, video_id):
video_data = config['video']
video_title = video_data.get('title')
live_event = video_data.get('live_event') or {}
is_live = live_event.get('status') == 'started'
live_status = {
'pending': 'is_upcoming',
'active': 'is_upcoming',
'started': 'is_live',
'ended': 'post_live',
}.get(live_event.get('status'))
is_live = live_status == 'is_live'
request = config.get('request') or {}
formats = []
@ -230,7 +237,8 @@ def _parse_config(self, config, video_id):
'chapters': chapters or None,
'formats': formats,
'subtitles': subtitles,
'is_live': is_live,
'live_status': live_status,
'release_timestamp': traverse_obj(live_event, ('ingest', 'scheduled_start_time', {parse_iso8601})),
# Note: Bitrates are completely broken. Single m3u8 may contain entries in kbps and bps
# at the same time without actual units specified.
'_format_sort_fields': ('quality', 'res', 'fps', 'hdr:12', 'source'),