mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 12:57:50 +08:00
重构
This commit is contained in:
@@ -141,13 +141,11 @@ def get_title(markup):
|
|||||||
|
|
||||||
|
|
||||||
def request_callback(future, index, datas):
|
def request_callback(future, index, datas):
|
||||||
try:
|
|
||||||
result = future.result()
|
result = future.result()
|
||||||
except Exception as e:
|
if isinstance(result, Exception):
|
||||||
logger.log('TRACE', e.args)
|
logger.log('TRACE', result.args)
|
||||||
datas[index]['reason'] = str(e.args)
|
datas[index]['reason'] = str(result.args)
|
||||||
datas[index]['valid'] = 0
|
datas[index]['valid'] = 0
|
||||||
else:
|
|
||||||
if isinstance(result, tuple):
|
if isinstance(result, tuple):
|
||||||
resp, text = result
|
resp, text = result
|
||||||
datas[index]['reason'] = resp.reason
|
datas[index]['reason'] = resp.reason
|
||||||
@@ -166,7 +164,7 @@ def request_callback(future, index, datas):
|
|||||||
datas[index]['header'] = str(dict(headers))[1:-1]
|
datas[index]['header'] = str(dict(headers))[1:-1]
|
||||||
datas[index]['response'] = utils.remove_string(text)
|
datas[index]['response'] = utils.remove_string(text)
|
||||||
else:
|
else:
|
||||||
datas[index]['reason'] = 'Something error'
|
datas[index]['reason'] = str(result)
|
||||||
datas[index]['valid'] = 0
|
datas[index]['valid'] = 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,9 @@ def resolve_callback(future, index, datas):
|
|||||||
if isinstance(answer, tuple):
|
if isinstance(answer, tuple):
|
||||||
ips = answer[2]
|
ips = answer[2]
|
||||||
datas[index]['ips'] = str(ips)[1:-1]
|
datas[index]['ips'] = str(ips)[1:-1]
|
||||||
|
else:
|
||||||
|
datas[index]['reason'] = str(answer)
|
||||||
|
datas[index]['valid'] = 0
|
||||||
|
|
||||||
|
|
||||||
async def bulk_query_a(datas):
|
async def bulk_query_a(datas):
|
||||||
|
|||||||
Reference in New Issue
Block a user