diff options
-rw-r--r-- | yt_dlp/downloader/http.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/yt_dlp/downloader/http.py b/yt_dlp/downloader/http.py index 9b7598b1c..12a2f0cc7 100644 --- a/yt_dlp/downloader/http.py +++ b/yt_dlp/downloader/http.py @@ -1,5 +1,6 @@ import os import random +import socket import ssl import time @@ -18,7 +19,13 @@ from ..utils import ( write_xattr, ) -RESPONSE_READ_EXCEPTIONS = (TimeoutError, ConnectionError, ssl.SSLError, compat_http_client.HTTPException) +RESPONSE_READ_EXCEPTIONS = ( + TimeoutError, + socket.timeout, # compat: py < 3.10 + ConnectionError, + ssl.SSLError, + compat_http_client.HTTPException +) class HttpFD(FileDownloader): |