fix: correct

escape sequences in fetch_proxy_list (syntax error)
This commit is contained in:
2026-04-13 18:16:23 +00:00
parent 6b17e8bc06
commit 7a7f9979cd

View File

@@ -469,10 +469,8 @@ def fetch_proxy_list(url: str) -> str:
log_connection(f"HTTP GET {url} (no-proxy)")
with NO_PROXY_OPENER.open(req, timeout=20) as resp:
text = resp.read(_PROXY_FETCH_LIMIT).decode("utf-8", "replace")
if "
" not in text and re.search(r"\s", text):
text = re.sub(r"\s+", "
", text.strip())
if "\n" not in text and re.search(r"\s", text):
text = re.sub(r"\s+", "\n", text.strip())
_proxy_cache[url] = (now, text)
return text