0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-30 03:33:02 +00:00

Fix --sleep-interval (#3426)

This commit is contained in:
Philipp Hagemeister 2015-01-23 12:07:13 +01:00
parent 5f0d813d93
commit 649f7966f7
2 changed files with 1 additions and 7 deletions

View file

@ -132,11 +132,6 @@ def _real_main(argv=None):
if numeric_limit is None: if numeric_limit is None:
parser.error('invalid rate limit specified') parser.error('invalid rate limit specified')
opts.ratelimit = numeric_limit opts.ratelimit = numeric_limit
if opts.sleepinterval is not None:
try:
opts.sleepinterval = abs(int(opts.sleepinterval))
except ValueError:
parser.error(u'invalid sleep interval specified')
if opts.min_filesize is not None: if opts.min_filesize is not None:
numeric_limit = FileDownloader.parse_bytes(opts.min_filesize) numeric_limit = FileDownloader.parse_bytes(opts.min_filesize)
if numeric_limit is None: if numeric_limit is None:
@ -272,7 +267,6 @@ def _real_main(argv=None):
'restrictfilenames': opts.restrictfilenames, 'restrictfilenames': opts.restrictfilenames,
'ignoreerrors': opts.ignoreerrors, 'ignoreerrors': opts.ignoreerrors,
'ratelimit': opts.ratelimit, 'ratelimit': opts.ratelimit,
'sleepinterval': opts.sleepinterval,
'nooverwrites': opts.nooverwrites, 'nooverwrites': opts.nooverwrites,
'retries': opts.retries, 'retries': opts.retries,
'buffersize': opts.buffersize, 'buffersize': opts.buffersize,

View file

@ -423,7 +423,7 @@ def _hide_login_info(opts):
help='Work around terminals that lack bidirectional text support. Requires bidiv or fribidi executable in PATH') help='Work around terminals that lack bidirectional text support. Requires bidiv or fribidi executable in PATH')
workarounds.add_option( workarounds.add_option(
'--sleep-interval', metavar='SECONDS', '--sleep-interval', metavar='SECONDS',
dest='sleep_interval', dest='sleep_interval', type=float,
help='Number of seconds to sleep before each download.') help='Number of seconds to sleep before each download.')
verbosity = optparse.OptionGroup(parser, 'Verbosity / Simulation Options') verbosity = optparse.OptionGroup(parser, 'Verbosity / Simulation Options')