Skip to content

Commit

Permalink
[ie/vimeo] Extract live_status and release_timestamp (yt-dlp#9290)
Browse files Browse the repository at this point in the history
Authored by: pzhlkj6612
  • Loading branch information
pzhlkj6612 authored Mar 2, 2024
1 parent d9b4154 commit f0426e9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions yt_dlp/extractor/vimeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
parse_qs,
smuggle_url,
str_or_none,
traverse_obj,
try_get,
unified_timestamp,
unsmuggle_url,
Expand Down Expand Up @@ -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 = []
Expand Down Expand Up @@ -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'),
Expand Down

0 comments on commit f0426e9

Please sign in to comment.