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