mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-25 04:35:52 +01:00
[ModifyChapters] Handle the entire video being marked for removal
Closes #5238
This commit is contained in:
parent
8fab23301c
commit
a7ddbc0475
@ -37,6 +37,9 @@ def run(self, info):
|
|||||||
info['chapters'], cuts = self._remove_marked_arrange_sponsors(chapters + sponsor_chapters)
|
info['chapters'], cuts = self._remove_marked_arrange_sponsors(chapters + sponsor_chapters)
|
||||||
if not cuts:
|
if not cuts:
|
||||||
return [], info
|
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']
|
original_duration, info['duration'] = info.get('duration'), info['chapters'][-1]['end_time']
|
||||||
if self._duration_mismatch(real_duration, original_duration, 1):
|
if self._duration_mismatch(real_duration, original_duration, 1):
|
||||||
|
Loading…
Reference in New Issue
Block a user