mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 12:57:50 +08:00
优化网络检查
This commit is contained in:
@@ -485,11 +485,15 @@ def delete_file(*paths):
|
|||||||
logger.log('ERROR', e.args)
|
logger.log('ERROR', e.args)
|
||||||
|
|
||||||
|
|
||||||
@tenacity.retry(stop=tenacity.stop_after_attempt(2))
|
@tenacity.retry(stop=tenacity.stop_after_attempt(3))
|
||||||
def check_net():
|
def check_net():
|
||||||
logger.log('INFOR', '正在检查网络环境')
|
logger.log('INFOR', '正在检查网络环境')
|
||||||
url = 'http://www.example.com/'
|
urls = ['http://www.example.com', 'http://www.baidu.com',
|
||||||
logger.log('INFOR', f'访问地址 {url}')
|
'http://www.bing.com', 'http://www.taobao.com',
|
||||||
|
'http://www.linkedin.com', 'http://www.msn.com',
|
||||||
|
'http://www.apple.com', 'http://microsoft.com']
|
||||||
|
url = random.choice(urls)
|
||||||
|
logger.log('INFOR', f'正在尝试访问 {url}')
|
||||||
try:
|
try:
|
||||||
rsp = requests.get(url)
|
rsp = requests.get(url)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -223,8 +223,8 @@ class OneForAll(object):
|
|||||||
:return: 总的子域结果
|
:return: 总的子域结果
|
||||||
:rtype: list
|
:rtype: list
|
||||||
"""
|
"""
|
||||||
utils.check_env()
|
|
||||||
print(banner)
|
print(banner)
|
||||||
|
utils.check_env()
|
||||||
dt = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
dt = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||||
print(f'[*] Starting OneForAll @ {dt}\n')
|
print(f'[*] Starting OneForAll @ {dt}\n')
|
||||||
logger.log('DEBUG', 'Python ' + utils.python_version())
|
logger.log('DEBUG', 'Python ' + utils.python_version())
|
||||||
|
|||||||
Reference in New Issue
Block a user