]> jfr.im git - yt-dlp.git/commitdiff
[ModifyChapters] Handle the entire video being marked for removal
authorpukkandan <redacted>
Tue, 18 Oct 2022 17:30:27 +0000 (23:00 +0530)
committerpukkandan <redacted>
Tue, 18 Oct 2022 17:38:24 +0000 (23:08 +0530)
Closes #5238

yt_dlp/postprocessor/modify_chapters.py

index b2b1acca40f900994c5ac6cc04e8fc131ad2bee7..a745b4524cdedfb0e8c94dc5fd71bab86fc99228 100644 (file)
@@ -37,6 +37,9 @@ def run(self, info):
         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):