|
@@ -1,4 +1,5 @@
|
|
|
# -*- coding: utf-8 -*-
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
+import re
|
|
|
|
|
|
|
|
import requests
|
|
import requests
|
|
|
from re import findall
|
|
from re import findall
|
|
@@ -39,9 +40,14 @@ def timeOutValidator(proxy):
|
|
|
'Connection': 'keep-alive',
|
|
'Connection': 'keep-alive',
|
|
|
'Accept-Language': 'zh-CN,zh;q=0.8'}
|
|
'Accept-Language': 'zh-CN,zh;q=0.8'}
|
|
|
try:
|
|
try:
|
|
|
- r = requests.head(conf.verifyUrl, headers=headers, proxies=proxies, timeout=conf.verifyTimeout, verify=False)
|
|
|
|
|
- if r.status_code == 200:
|
|
|
|
|
|
|
+ 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
|
|
return True
|
|
|
|
|
+ # r = requests.head(conf.verifyUrl, headers=headers, proxies=proxies, timeout=conf.verifyTimeout, verify=False)
|
|
|
|
|
+ # if r.status_code == 200:
|
|
|
|
|
+ # return True
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
pass
|
|
pass
|
|
|
return False
|
|
return False
|