mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-10-31 07:50:11 +01:00
[ie/vimeo] Extract live_status
and release_timestamp
(#9290)
Authored by: pzhlkj6612
This commit is contained in:
parent
d9b4154cbc
commit
f0426e9ca5
@ -21,6 +21,7 @@
|
|||||||
parse_qs,
|
parse_qs,
|
||||||
smuggle_url,
|
smuggle_url,
|
||||||
str_or_none,
|
str_or_none,
|
||||||
|
traverse_obj,
|
||||||
try_get,
|
try_get,
|
||||||
unified_timestamp,
|
unified_timestamp,
|
||||||
unsmuggle_url,
|
unsmuggle_url,
|
||||||
@ -121,7 +122,13 @@ def _parse_config(self, config, video_id):
|
|||||||
video_data = config['video']
|
video_data = config['video']
|
||||||
video_title = video_data.get('title')
|
video_title = video_data.get('title')
|
||||||
live_event = video_data.get('live_event') or {}
|
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 {}
|
request = config.get('request') or {}
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
@ -230,7 +237,8 @@ def _parse_config(self, config, video_id):
|
|||||||
'chapters': chapters or None,
|
'chapters': chapters or None,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'subtitles': subtitles,
|
'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
|
# Note: Bitrates are completely broken. Single m3u8 may contain entries in kbps and bps
|
||||||
# at the same time without actual units specified.
|
# at the same time without actual units specified.
|
||||||
'_format_sort_fields': ('quality', 'res', 'fps', 'hdr:12', 'source'),
|
'_format_sort_fields': ('quality', 'res', 'fps', 'hdr:12', 'source'),
|
||||||
|
Loading…
Reference in New Issue
Block a user