mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-11 07:27:14 +08:00
Allow for infinite retries with retries option 0
Allow for infinite retries if the -R retries option was set as 0
This commit is contained in:
parent
c4cb885a44
commit
f01e218ae2
@ -580,7 +580,7 @@ class FileDownloader(object):
|
|||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
retries = self.params['retries']
|
retries = self.params['retries']
|
||||||
while count <= retries:
|
while retries == 0 or count < retries:
|
||||||
# Establish connection
|
# Establish connection
|
||||||
try:
|
try:
|
||||||
if count == 0 and 'urlhandle' in info_dict:
|
if count == 0 and 'urlhandle' in info_dict:
|
||||||
@ -624,7 +624,7 @@ class FileDownloader(object):
|
|||||||
if count <= retries:
|
if count <= retries:
|
||||||
self.report_retry(count, retries)
|
self.report_retry(count, retries)
|
||||||
|
|
||||||
if count > retries:
|
if retries != 0 and count > retries:
|
||||||
self.trouble(u'ERROR: giving up after %s retries' % retries)
|
self.trouble(u'ERROR: giving up after %s retries' % retries)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user