From cfe8e578b8581107a7491ce3f818712206ba2720 Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Wed, 28 Jul 2021 21:02:35 +0200 Subject: [PATCH] dont retry known-good hosts --- panxy.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/panxy.py b/panxy.py index 8f741d9..f73ed6f 100644 --- a/panxy.py +++ b/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: