|
|
@@ -44,7 +44,7 @@ def timeOutValidator(proxy):
|
|
|
if r.status_code == 200:
|
|
|
return True
|
|
|
except Exception as e:
|
|
|
- pass
|
|
|
+ return False
|
|
|
return False
|
|
|
|
|
|
|
|
|
@@ -55,11 +55,15 @@ def customValidator(proxy):
|
|
|
:param proxy:
|
|
|
:return:
|
|
|
"""
|
|
|
- proxies = {"http": "http://{proxy}".format(proxy=proxy), "https": "https://{proxy}".format(proxy=proxy)}
|
|
|
- r = requests.get(url='http://myip.ipip.net', proxies=proxies, timeout=conf.verifyTimeout, verify=False)
|
|
|
- proxies = re.findall(r'(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})',
|
|
|
- r.text)
|
|
|
- if len(proxies) > 0:
|
|
|
- return True
|
|
|
- else:
|
|
|
- return False
|
|
|
+ try:
|
|
|
+ proxies = {"http": "http://{proxy}".format(proxy=proxy), "https": "https://{proxy}".format(proxy=proxy)}
|
|
|
+ r = requests.get(url='http://myip.ipip.net', proxies=proxies, timeout=conf.verifyTimeout, verify=False)
|
|
|
+ proxies = re.findall(r'(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})',
|
|
|
+ r.text)
|
|
|
+ if len(proxies) > 0:
|
|
|
+ return True
|
|
|
+ else:
|
|
|
+ return False
|
|
|
+ except Exception as e:
|
|
|
+ return False
|
|
|
+ return False
|