diff options
author | lazypete365 <lazypete365@users.noreply.github.com> | 2022-07-31 22:12:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-01 01:42:04 +0530 |
commit | e325a21a1f9a007fa7fd0c9a702ce12404157e24 (patch) | |
tree | 5b1147db8596ef4d6106e692a95c63fdf775983f /yt_dlp | |
parent | 3df4f81dfe57e973a4ae79552e13828f616d74ea (diff) | |
download | hypervideo-pre-e325a21a1f9a007fa7fd0c9a702ce12404157e24.tar.lz hypervideo-pre-e325a21a1f9a007fa7fd0c9a702ce12404157e24.tar.xz hypervideo-pre-e325a21a1f9a007fa7fd0c9a702ce12404157e24.zip |
[extractor/youtube] Add `live_status=post_live` (#4495)
Related: https://github.com/yt-dlp/yt-dlp/issues/1564
Authored by: lazypete365
Diffstat (limited to 'yt_dlp')
-rw-r--r-- | yt_dlp/extractor/common.py | 3 | ||||
-rw-r--r-- | yt_dlp/extractor/youtube.py | 15 |
2 files changed, 10 insertions, 8 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index fc087a69c..d168763e0 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -312,7 +312,8 @@ class InfoExtractor: live stream that goes on instead of a fixed-length video. was_live: True, False, or None (=unknown). Whether this video was originally a live stream. - live_status: 'is_live', 'is_upcoming', 'was_live', 'not_live' or None (=unknown) + live_status: None (=unknown), 'is_live', 'is_upcoming', 'was_live', 'not_live' + or 'post_live' (was live, but VOD is not yet processed) If absent, automatically set from is_live, was_live start_time: Time in seconds where the reproduction should start, as specified in the URL. diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 02305c3f9..fb23afbad 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -3463,13 +3463,6 @@ class YoutubeIE(YoutubeBaseInfoExtractor): or get_first(microformats, 'lengthSeconds') or parse_duration(search_meta('duration'))) or None - if get_first(video_details, 'isPostLiveDvr'): - self.write_debug('Video is in Post-Live Manifestless mode') - if (duration or 0) > 4 * 3600: - self.report_warning( - 'The livestream has not finished processing. Only 4 hours of the video can be currently downloaded. ' - 'This is a known issue and patches are welcome') - live_broadcast_details, is_live, streaming_data, formats, automatic_captions = \ self._list_formats(video_id, microformats, video_details, player_responses, player_url) @@ -3600,6 +3593,14 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'release_timestamp': live_start_time, } + if get_first(video_details, 'isPostLiveDvr'): + self.write_debug('Video is in Post-Live Manifestless mode') + info['live_status'] = 'post_live' + if (duration or 0) > 4 * 3600: + self.report_warning( + 'The livestream has not finished processing. Only 4 hours of the video can be currently downloaded. ' + 'This is a known issue and patches are welcome') + subtitles = {} pctr = traverse_obj(player_responses, (..., 'captions', 'playerCaptionsTracklistRenderer'), expected_type=dict) if pctr: |