1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2026-05-03 12:13:35 +00:00

[downloader/http] Improve timeout detection when reading block of data (refs #10935)

This commit is contained in:
Sergey M․
2020-09-18 03:32:54 +07:00
parent 86b7c00adc
commit cdc55e666f
+5 -3
View File
@@ -238,9 +238,11 @@ class HttpFD(FileDownloader):
except socket.timeout as e:
retry(e)
except socket.error as e:
if e.errno not in (errno.ECONNRESET, errno.ETIMEDOUT):
raise
retry(e)
# SSLError on python 2 (inherits socket.error) may have
# no errno set but this error message
if e.errno in (errno.ECONNRESET, errno.ETIMEDOUT) or getattr(e, 'message') == 'The read operation timed out':
retry(e)
raise
byte_counter += len(data_block)