From 3cbcbc06c3cc70bda0e1e0d0a512780a2b3dedc8 Mon Sep 17 00:00:00 2001 From: Ville Ranki Date: Wed, 4 Nov 2020 22:18:34 +0200 Subject: [PATCH] Changed Url module timeout and maxsize to get youtube working again --- modules/url.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/url.py b/modules/url.py index f2c398b..8763f25 100644 --- a/modules/url.py +++ b/modules/url.py @@ -122,7 +122,7 @@ class MatrixModule(BotModule): title = None description = None # timeout will still handle network timeouts - timeout = httpx.Timeout(10.0, connect=2.0, read=5.0) + timeout = httpx.Timeout(10.0) responsetext = "" # read our response here try: self.logger.debug(f"start streaming {url}") @@ -130,7 +130,7 @@ class MatrixModule(BotModule): # as we are using stream the r.text wont be available, save our read data ourself # maximum size to read of the response in characters (this prevents us from reading stream forever) - maxsize = 100000 + maxsize = 800000 with httpx.stream("GET", url, timeout=timeout) as r: for part in r.iter_text(): self.logger.debug(