fix: correct
escape sequences in fetch_proxy_list (syntax error)
This commit is contained in:
@@ -469,10 +469,8 @@ def fetch_proxy_list(url: str) -> str:
|
|||||||
log_connection(f"HTTP GET {url} (no-proxy)")
|
log_connection(f"HTTP GET {url} (no-proxy)")
|
||||||
with NO_PROXY_OPENER.open(req, timeout=20) as resp:
|
with NO_PROXY_OPENER.open(req, timeout=20) as resp:
|
||||||
text = resp.read(_PROXY_FETCH_LIMIT).decode("utf-8", "replace")
|
text = resp.read(_PROXY_FETCH_LIMIT).decode("utf-8", "replace")
|
||||||
if "
|
if "\n" not in text and re.search(r"\s", text):
|
||||||
" not in text and re.search(r"\s", text):
|
text = re.sub(r"\s+", "\n", text.strip())
|
||||||
text = re.sub(r"\s+", "
|
|
||||||
", text.strip())
|
|
||||||
_proxy_cache[url] = (now, text)
|
_proxy_cache[url] = (now, text)
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user