From 0500ee3d81c5d31500d7093512deee2b0ff8aacd Mon Sep 17 00:00:00 2001 From: pukkandan Date: Mon, 26 Sep 2022 03:03:52 +0530 Subject: Don't download entire video when no matching `--download-sections` --- yt_dlp/utils.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'yt_dlp/utils.py') diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index f93573692..d655bfdd0 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -3793,6 +3793,9 @@ class download_range_func: self.chapters, self.ranges = chapters, ranges def __call__(self, info_dict, ydl): + if not self.ranges and not self.chapters: + yield {} + warning = ('There are no chapters matching the regex' if info_dict.get('chapters') else 'Cannot match chapters since chapter information is unavailable') for regex in self.chapters or []: -- cgit v1.2.3