mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-11-14 22:37:59 +09:00
Retry on any 5xx server error
This commit is contained in:
parent
e86e9474bf
commit
ac249f421f
@ -529,7 +529,7 @@ class FileDownloader(object):
|
|||||||
data = urllib2.urlopen(request)
|
data = urllib2.urlopen(request)
|
||||||
break
|
break
|
||||||
except (urllib2.HTTPError, ), err:
|
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
|
# Unexpected HTTP error
|
||||||
raise
|
raise
|
||||||
elif err.code == 416:
|
elif err.code == 416:
|
||||||
@ -539,7 +539,7 @@ class FileDownloader(object):
|
|||||||
data = urllib2.urlopen(basic_request)
|
data = urllib2.urlopen(basic_request)
|
||||||
content_length = data.info()['Content-Length']
|
content_length = data.info()['Content-Length']
|
||||||
except (urllib2.HTTPError, ), err:
|
except (urllib2.HTTPError, ), err:
|
||||||
if err.code != 503 and err.code != 500:
|
if err.code < 500 or err.code >= 600:
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
# Examine the reported length
|
# Examine the reported length
|
||||||
|
Loading…
Reference in New Issue
Block a user