mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-06 00:55:37 +08:00
Edited code and documentation for infinite retries
Changed code to accept "0" or "inf" for infinite retries (like wget), and modified OptParse help documentation to reflect changes.
This commit is contained in:
parent
148749e919
commit
147054c4d9
@ -188,7 +188,7 @@ def parseOpts():
|
|||||||
general.add_option('-r', '--rate-limit',
|
general.add_option('-r', '--rate-limit',
|
||||||
dest='ratelimit', metavar='LIMIT', help='download rate limit (e.g. 50k or 44.6m)')
|
dest='ratelimit', metavar='LIMIT', help='download rate limit (e.g. 50k or 44.6m)')
|
||||||
general.add_option('-R', '--retries',
|
general.add_option('-R', '--retries',
|
||||||
dest='retries', metavar='RETRIES', help='number of retries (default is %default)', default=10)
|
dest='retries', metavar='RETRIES', help='number of retries (default is %default). specify 0 or inf for infinite retries', default=10)
|
||||||
general.add_option('--dump-user-agent',
|
general.add_option('--dump-user-agent',
|
||||||
action='store_true', dest='dump_user_agent',
|
action='store_true', dest='dump_user_agent',
|
||||||
help='display the current browser identification', default=False)
|
help='display the current browser identification', default=False)
|
||||||
@ -442,6 +442,7 @@ def _real_main():
|
|||||||
parser.error(u'invalid rate limit specified')
|
parser.error(u'invalid rate limit specified')
|
||||||
opts.ratelimit = numeric_limit
|
opts.ratelimit = numeric_limit
|
||||||
try:
|
try:
|
||||||
|
if opts.retries = "inf": opts.retries = 0
|
||||||
opts.retries = long(opts.retries)
|
opts.retries = long(opts.retries)
|
||||||
except (TypeError, ValueError), err:
|
except (TypeError, ValueError), err:
|
||||||
parser.error(u'invalid retry count specified')
|
parser.error(u'invalid retry count specified')
|
||||||
|
Loading…
Reference in New Issue
Block a user