From 84e8dc328ceba818a7414262727919995736e285 Mon Sep 17 00:00:00 2001 From: tpv Date: Sun, 21 Jun 2026 14:59:37 -0700 Subject: [PATCH] testing proxies formatting --- monitor_utils/config.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/monitor_utils/config.py b/monitor_utils/config.py index 2742acb..f474764 100644 --- a/monitor_utils/config.py +++ b/monitor_utils/config.py @@ -28,20 +28,19 @@ def get_bot_token(is_production: bool) -> str: @cache def get_proxies() -> list[str]: - parts = p.strip().split(":") - print(len(parts), parts) with PROXIES_PATH.open() as f: proxies = [] - for p in f: - if not p.strip(): + for line in f: + line = line.strip() + if not line: continue - parts = p.strip().split(":") - if len(parts) == 4: + parts = line.split(":", 3) + if len(parts) == 4 and not parts[1].startswith("//"): host, port, user, password = parts proxies.append(f"http://{user}:{password}@{host}:{port}") else: - proxies.append(f"http://{p.strip()}") + proxies.append(f"http://{line}") if not proxies: raise ValueError("Proxy list cannot be empty")