1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-11-01 07:05:14 +00:00

[test] Fix connect timeout test (#9906)

Fixes https://github.com/yt-dlp/yt-dlp/issues/9659

Authored by: coletdjnz
This commit is contained in:
coletdjnz
2024-05-18 19:12:21 +12:00
committed by GitHub
parent c999bac02c
commit 53b4d44f55
3 changed files with 31 additions and 16 deletions

View File

@@ -31,6 +31,8 @@ from ..utils import (
)
from ..utils.networking import HTTPHeaderDict, normalize_url
DEFAULT_TIMEOUT = 20
def register_preference(*handlers: type[RequestHandler]):
assert all(issubclass(handler, RequestHandler) for handler in handlers)
@@ -235,7 +237,7 @@ class RequestHandler(abc.ABC):
self._logger = logger
self.headers = headers or {}
self.cookiejar = cookiejar if cookiejar is not None else YoutubeDLCookieJar()
self.timeout = float(timeout or 20)
self.timeout = float(timeout or DEFAULT_TIMEOUT)
self.proxies = proxies or {}
self.source_address = source_address
self.verbose = verbose