dont retry known-good hosts

master
Felix Pankratz 3 years ago
parent cea5062d10
commit cfe8e578b8

@ -31,6 +31,9 @@ def test_proxy(prx):
try:
result = opener.open(target, timeout=6)
content = result.read().decode()
if prx.split(':')[0] not in content:
print(srv_string + 'bait.')
return False
print(srv_string + 'ok. \u2705')
return True
except error.HTTPError:
@ -47,12 +50,12 @@ def test_proxy(prx):
return False
def get_proxies():
proxy_list = get_list_from_api()
working_list = []
start_length = len(proxy_list)
try:
for entry in proxy_list:
if entry not in working_list:
if test_proxy(entry):
working_list.append(entry)
else:

Loading…
Cancel
Save