From 96a6277a0141b583f3f00d51474c1398b924cda8 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Sun, 3 Apr 2022 15:26:36 +0200 Subject: [PATCH] log proxy failure --- backend/stream.py | 4 ++-- backend/stream_providers.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/backend/stream.py b/backend/stream.py index 4aa2355..07b3a1f 100755 --- a/backend/stream.py +++ b/backend/stream.py @@ -40,7 +40,8 @@ class UpstreamHandler: port = splitted[1] future = asyncio.open_connection(host=host, port=port) await asyncio.wait_for(future, timeout=1) - except Exception: + except Exception as e: + logger.info(e) return (False, proxy) else: return (True, proxy) @@ -79,7 +80,6 @@ class UpstreamHandler: for future in asyncio.as_completed(futures): success, current = await future if success: - logger.info(current) self.proxy = current break for future in futures: diff --git a/backend/stream_providers.py b/backend/stream_providers.py index 01eb29c..8050471 100755 --- a/backend/stream_providers.py +++ b/backend/stream_providers.py @@ -122,8 +122,6 @@ class StreamProvider: self.upstream = upstream self.proxy = None self.logger = logger - self.logger.info("%s <%s>", proxy, upstream) - self.logger.info("%s <%s>", type(proxy), upstream) if isinstance(proxy, config.ProxyElem): self.proxy = proxy @@ -165,7 +163,6 @@ class StreamProvider: proxies = {} proxies["http"] = "socks5://" + self.proxy.proxy proxies["https"] = "socks5://" + self.proxy.proxy - self.logger.info("%s <%s>", proxies, self.upstream) ctype = None upstream = data.upstream()