Skip to content

Commit

Permalink
Retry on any 5xx server error
Browse files Browse the repository at this point in the history
  • Loading branch information
rg3 committed Oct 31, 2010
1 parent e86e947 commit ac249f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions youtube-dl
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit ac249f4

Please sign in to comment.