From: Ricardo Garcia Date: Sun, 3 Oct 2010 09:05:20 +0000 (+0200) Subject: Retry on any 5xx server error X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=ac249f421f5d7a9d9272d478f2f5e246ed497c47;p=youtube-dl Retry on any 5xx server error --- diff --git a/youtube-dl b/youtube-dl index 54881a4d8..48258419f 100755 --- a/youtube-dl +++ b/youtube-dl @@ -529,7 +529,7 @@ class FileDownloader(object): data = urllib2.urlopen(request) break except (urllib2.HTTPError, ), err: - if err.code != 500 and err.code != 503 and err.code != 416: + if (err.code < 500 or err.code >= 600) and err.code != 416: # Unexpected HTTP error raise elif err.code == 416: @@ -539,7 +539,7 @@ class FileDownloader(object): data = urllib2.urlopen(basic_request) content_length = data.info()['Content-Length'] except (urllib2.HTTPError, ), err: - if err.code != 503 and err.code != 500: + if err.code < 500 or err.code >= 600: raise else: # Examine the reported length