0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-25 02:45:12 +00:00

[http] Retry on socket timeout

Closes #1222
This commit is contained in:
pukkandan 2021-10-19 18:52:17 +05:30
parent e619d8a752
commit 9fab498fbf
No known key found for this signature in database
GPG key ID: 0F00D95A001F4698

View file

@ -191,11 +191,13 @@ def establish_connection():
# Unexpected HTTP error # Unexpected HTTP error
raise raise
raise RetryDownload(err) raise RetryDownload(err)
except socket.error as err: except socket.timeout as err:
if err.errno != errno.ECONNRESET:
# Connection reset is no problem, just retry
raise
raise RetryDownload(err) raise RetryDownload(err)
except socket.error as err:
if err.errno in (errno.ECONNRESET, errno.ETIMEDOUT):
# Connection reset is no problem, just retry
raise RetryDownload(err)
raise
def download(): def download():
nonlocal throttle_start nonlocal throttle_start