aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/utils.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-09-26 03:03:52 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-09-26 03:04:32 +0530
commit0500ee3d81c5d31500d7093512deee2b0ff8aacd (patch)
tree26d2527a2b81b8f4b6c81ffb083b54a56a60e522 /yt_dlp/utils.py
parent46a5b335e708c81bb6e9eb8cef0c13c72c497f0a (diff)
downloadhypervideo-pre-0500ee3d81c5d31500d7093512deee2b0ff8aacd.tar.lz
hypervideo-pre-0500ee3d81c5d31500d7093512deee2b0ff8aacd.tar.xz
hypervideo-pre-0500ee3d81c5d31500d7093512deee2b0ff8aacd.zip
Don't download entire video when no matching `--download-sections`
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r--yt_dlp/utils.py3
1 files changed, 3 insertions, 0 deletions
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 []: