X-Git-Url: https://jfr.im/git/yt-dlp.git/blobdiff_plain/63c547d71ceae6be181948b4b6ce4180b16f4209..800a43983e5fb719526ce4cb3956216085c63268:/yt_dlp/postprocessor/modify_chapters.py diff --git a/yt_dlp/postprocessor/modify_chapters.py b/yt_dlp/postprocessor/modify_chapters.py index b2b1acca4..f5219868c 100644 --- a/yt_dlp/postprocessor/modify_chapters.py +++ b/yt_dlp/postprocessor/modify_chapters.py @@ -23,6 +23,7 @@ def __init__(self, downloader, remove_chapters_patterns=None, remove_sponsor_seg @PostProcessor._restrict_to(images=False) def run(self, info): + self._fixup_chapters(info) # Chapters must be preserved intact when downloading multiple formats of the same video. chapters, sponsor_chapters = self._mark_chapters_to_remove( copy.deepcopy(info.get('chapters')) or [], @@ -37,6 +38,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):