1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-02-03 15:32:51 +08:00

fix behavior when max_files not set

This commit is contained in:
Vladimir Berezhnoy 2011-11-27 19:41:24 +04:00
parent fa0d627720
commit 1080820b50

View File

@ -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