]> jfr.im git - yt-dlp.git/commitdiff
Fix end time of clips (#5255)
authorcruel-efficiency <redacted>
Tue, 18 Oct 2022 12:51:43 +0000 (05:51 -0700)
committerGitHub <redacted>
Tue, 18 Oct 2022 12:51:43 +0000 (18:21 +0530)
Closes #5256
Authored by: cruel-efficiency

yt_dlp/YoutubeDL.py

index 4e57dffa327501f43aba983a4acbf3bba52f3e4a..13725cddc3de8c798ec39b3f6476489f95aa912e 100644 (file)
@@ -2720,7 +2720,8 @@ def to_screen(*msg):
                 if chapter or offset:
                     new_info.update({
                         'section_start': offset + chapter.get('start_time', 0),
-                        'section_end': end_time if end_time < offset + duration else None,
+                        # duration may not be accurate. So allow deviations <1sec
+                        'section_end': end_time if end_time <= offset + duration + 1 else None,
                         'section_title': chapter.get('title'),
                         'section_number': chapter.get('index'),
                     })