dont retry known-good hosts
This commit is contained in:
parent
cea5062d10
commit
cfe8e578b8
9
panxy.py
9
panxy.py
@ -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,14 +50,14 @@ 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 test_proxy(entry):
|
||||
working_list.append(entry)
|
||||
if entry not in working_list:
|
||||
if test_proxy(entry):
|
||||
working_list.append(entry)
|
||||
else:
|
||||
pass
|
||||
except KeyboardInterrupt:
|
||||
|
Loading…
Reference in New Issue
Block a user