1
0
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:
Sepero 2012-10-30 22:09:11 -03:00
parent c4cb885a44
commit f01e218ae2

View File

@ -580,7 +580,7 @@ class FileDownloader(object):
count = 0
retries = self.params['retries']
while count <= retries:
while retries == 0 or count < retries:
# Establish connection
try:
if count == 0 and 'urlhandle' in info_dict:
@ -624,7 +624,7 @@ class FileDownloader(object):
if 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)
return False