aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-10-18 23:00:27 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-10-18 23:08:24 +0530
commita7ddbc0475db14d5249a312e4e03aaf0adc82647 (patch)
treea125a014ede114f82544d479e85840f3edecc9f2
parent8fab23301c79a927592dda710a60903423beffbb (diff)
downloadhypervideo-pre-a7ddbc0475db14d5249a312e4e03aaf0adc82647.tar.lz
hypervideo-pre-a7ddbc0475db14d5249a312e4e03aaf0adc82647.tar.xz
hypervideo-pre-a7ddbc0475db14d5249a312e4e03aaf0adc82647.zip
[ModifyChapters] Handle the entire video being marked for removal
Closes #5238
-rw-r--r--yt_dlp/postprocessor/modify_chapters.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/yt_dlp/postprocessor/modify_chapters.py b/yt_dlp/postprocessor/modify_chapters.py
index b2b1acca4..a745b4524 100644
--- a/yt_dlp/postprocessor/modify_chapters.py
+++ b/yt_dlp/postprocessor/modify_chapters.py
@@ -37,6 +37,9 @@ class ModifyChaptersPP(FFmpegPostProcessor):
info['chapters'], cuts = self._remove_marked_arrange_sponsors(chapters + sponsor_chapters)
if not cuts:
return [], info
+ elif not info['chapters']:
+ self.report_warning('You have requested to remove the entire video, which is not possible')
+ return [], info
original_duration, info['duration'] = info.get('duration'), info['chapters'][-1]['end_time']
if self._duration_mismatch(real_duration, original_duration, 1):