1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-12-16 04:58:56 +00:00

Support negative durations

This commit is contained in:
Elyse
2023-03-10 15:20:40 -06:00
parent 9fc70f3f6d
commit e6e2eb00f1
3 changed files with 16 additions and 23 deletions

View File

@@ -2764,8 +2764,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
begin_index = 0
download_start_time = ctx.get('start') or time.time()
section_start = ctx.get('section_start') or 0
section_end = ctx.get('section_end') or math.inf
section_start = 0 if ctx.get('section_start') is None else download_start_time + ctx['section_start']
section_end = math.inf if ctx.get('section_end') is None else download_start_time + ctx['section_end']
lack_early_segments = download_start_time - (live_start_time or download_start_time) > MAX_DURATION
if lack_early_segments: