]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/utils.py
Don't download entire video when no matching `--download-sections`
[yt-dlp.git] / yt_dlp / utils.py
index f93573692282bea8da548374644bf23cda7a0f55..d655bfdd038cb47bd39ddfa19bd1f778f0977224 100644 (file)
@@ -3793,6 +3793,9 @@ def __init__(self, chapters, ranges):
         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 []: