]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[downloader/external] Fix infinite retries for curl (closes #19303)
authorSergey M․ <dstftw@gmail.com>
Fri, 22 Feb 2019 17:43:29 +0000 (00:43 +0700)
committerSergey M․ <dstftw@gmail.com>
Fri, 22 Feb 2019 17:43:29 +0000 (00:43 +0700)
youtube_dl/downloader/external.py

index 958d00aac0ae0a3d58eca9069429cd305a137449..0b88bfd94c46f42c375b77b8988c7221580d01b6 100644 (file)
@@ -121,7 +121,11 @@ class CurlFD(ExternalFD):
         cmd += self._valueless_option('--silent', 'noprogress')
         cmd += self._valueless_option('--verbose', 'verbose')
         cmd += self._option('--limit-rate', 'ratelimit')
-        cmd += self._option('--retry', 'retries')
+        retry = self._option('--retry', 'retries')
+        if len(retry) == 2:
+            if retry[1] in ('inf', 'infinite'):
+                retry[1] = '2147483647'
+            cmd += retry
         cmd += self._option('--max-filesize', 'max_filesize')
         cmd += self._option('--interface', 'source_address')
         cmd += self._option('--proxy', 'proxy')