aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcoletdjnz <coletdjnz@protonmail.com>2022-05-17 09:17:37 +1200
committercoletdjnz <coletdjnz@protonmail.com>2022-05-17 09:17:37 +1200
commit5faf6528fb701724ac32e0a487f92281c7800bda (patch)
tree1694042f615dc47519fdb5ed744c5d45460d252d
parent0fa7d2c8e46ea8820fbffe706af7a845070e739d (diff)
downloadhypervideo-pre-5faf6528fb701724ac32e0a487f92281c7800bda.tar.lz
hypervideo-pre-5faf6528fb701724ac32e0a487f92281c7800bda.tar.xz
hypervideo-pre-5faf6528fb701724ac32e0a487f92281c7800bda.zip
[http] Fix bug in retrying on read timeout in py < 3.10
socket.timeout is not an alias of TimeoutError in py < 3.10 Fixes bug in https://github.com/yt-dlp/yt-dlp/commit/a2e77303e3385da640a0904cd6cb76235fa9691b Authored-by: coletdjnz
-rw-r--r--yt_dlp/downloader/http.py9
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):