From 370ff77f21635dc9579e1ab49b15010a84ffcef8 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:23:41 +0200 Subject: [PATCH] Double read timeout to fix 'The read operation timed out' 5 seconds is the default --- src/pylast/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pylast/__init__.py b/src/pylast/__init__.py index c94e714..d180a48 100644 --- a/src/pylast/__init__.py +++ b/src/pylast/__init__.py @@ -894,6 +894,7 @@ class _Request: username = "" if username is None else f"?username={username}" (host_name, host_subdir) = self.network.ws_server + timeout = httpx.Timeout(5, read=10) if self.network.is_proxy_enabled(): client = httpx.Client( @@ -901,12 +902,14 @@ class _Request: base_url=f"https://{host_name}", headers=HEADERS, proxies=self.network.proxy, + timeout=timeout, ) else: client = httpx.Client( verify=SSL_CONTEXT, base_url=f"https://{host_name}", headers=HEADERS, + timeout=timeout, ) try: