aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcruel-efficiency <60464829+cruel-efficiency@users.noreply.github.com>2022-10-18 05:51:43 -0700
committerGitHub <noreply@github.com>2022-10-18 18:21:43 +0530
commit2576d53a312efee864af023ea819c6608558bd1b (patch)
tree319ab3d84ec0c587bd273bd21b5273123d1f299f
parent217753f4aa184a5dac0d7c91c1f95de8b1880474 (diff)
downloadhypervideo-pre-2576d53a312efee864af023ea819c6608558bd1b.tar.lz
hypervideo-pre-2576d53a312efee864af023ea819c6608558bd1b.tar.xz
hypervideo-pre-2576d53a312efee864af023ea819c6608558bd1b.zip
Fix end time of clips (#5255)
Closes #5256 Authored by: cruel-efficiency
-rw-r--r--yt_dlp/YoutubeDL.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index 4e57dffa3..13725cddc 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -2720,7 +2720,8 @@ class YoutubeDL:
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'),
})