From 1080820b50db0d1bdf351d34b2f69d8f68664851 Mon Sep 17 00:00:00 2001 From: Vladimir Berezhnoy Date: Sun, 27 Nov 2011 19:41:24 +0400 Subject: [PATCH] fix behavior when max_files not set --- youtube-dl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/youtube-dl b/youtube-dl index b98d3b42a..3f762e528 100755 --- a/youtube-dl +++ b/youtube-dl @@ -702,8 +702,9 @@ class FileDownloader(object): """Process a single dictionary returned by an InfoExtractor.""" filename = self.prepare_filename(info_dict) - # Stop downloading at max_files - if int(self._num_downloads) > int(self.params.get('max_files', 0)): + # Stop downloading at max_files (0 means no limit) + if int(self.params.get('max_files', 0)) != 0 and \ + (int(self._num_downloads) > int(self.params.get('max_files', 0))): return # Forced printings