"""
pass
+class MaxDownloadsReached(Exception):
+ """ --max-downloads limit has been reached. """
+ pass
+
class UnavailableVideoError(Exception):
"""Unavailable Format exception.
max_downloads = self.params.get('max_downloads')
if max_downloads is not None:
if self._num_downloads > int(max_downloads):
- self.to_screen(u'[download] Maximum number of downloads reached. Skipping ' + info_dict['title'])
- return
+ raise MaxDownloadsReached()
filename = self.prepare_filename(info_dict)
parser.error(u'you must provide at least one URL')
else:
sys.exit()
- retcode = fd.download(all_urls)
+
+ try:
+ retcode = fd.download(all_urls)
+ except MaxDownloadsReached:
+ fd.to_screen(u'--max-download limit reached, aborting.')
+ retcode = 101
# Dump cookie jar if requested
if opts.cookiefile is not None: