|
|
|
@ -7,8 +7,8 @@ import sys
|
|
|
|
|
target = "http://theresno.cloud/ip"
|
|
|
|
|
prx_api = "http://pubproxy.com/api/proxy?limit=10&http=true&format=txt"
|
|
|
|
|
|
|
|
|
|
def get_list():
|
|
|
|
|
print('Requesting proxy list...')
|
|
|
|
|
def get_list_from_api():
|
|
|
|
|
print('Requesting proxy list... ', end='')
|
|
|
|
|
result = request.urlopen(prx_api)
|
|
|
|
|
prx_list = result.read().decode().split('\n')
|
|
|
|
|
print('Got {} proxies.'.format(len(prx_list)))
|
|
|
|
@ -27,8 +27,6 @@ def test_proxy(prx):
|
|
|
|
|
except error.HTTPError:
|
|
|
|
|
print(srv_string + 'fail. \u274c')
|
|
|
|
|
return False
|
|
|
|
|
#except RemoteDisconnected:
|
|
|
|
|
# print('fail.')
|
|
|
|
|
except error.URLError:
|
|
|
|
|
print(srv_string + 'down! \u2935')
|
|
|
|
|
return False
|
|
|
|
@ -38,11 +36,10 @@ def test_proxy(prx):
|
|
|
|
|
except socket.timeout:
|
|
|
|
|
print(srv_string + 'timeout! \u23f3')
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_proxies():
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
|
|
|
|
|
proxy_list = get_list()
|
|
|
|
|
proxy_list = get_list_from_api()
|
|
|
|
|
working_list = []
|
|
|
|
|
start_length = len(proxy_list)
|
|
|
|
|
for entry in proxy_list:
|
|
|
|
@ -50,7 +47,18 @@ def main():
|
|
|
|
|
working_list.append(entry)
|
|
|
|
|
else:
|
|
|
|
|
pass
|
|
|
|
|
print('{}/{} proxies ready.'.format(len(working_list), start_length))
|
|
|
|
|
print('{}/{} new proxies ready.'.format(len(working_list), start_length))
|
|
|
|
|
return working_list
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
proxies = []
|
|
|
|
|
while True:
|
|
|
|
|
proxies += get_proxies()
|
|
|
|
|
print('{} proxies total ready.'.format(len(proxies)))
|
|
|
|
|
choice = input('retry or continue? r|c ')
|
|
|
|
|
if choice == 'c':
|
|
|
|
|
break
|
|
|
|
|
print(proxies)
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
main()
|
|
|
|
|