优化跳转历史

This commit is contained in:
Jing Ling
2020-08-20 22:57:14 +08:00
parent 3f5e416c0a
commit 754417d8a9
+8 -1
View File
@@ -154,6 +154,13 @@ def get_title(markup):
return 'None' return 'None'
def get_jump_urls(history):
urls = list()
for resp in history:
urls.append(str(resp.url))
return urls
def request_callback(future, index, datas): def request_callback(future, index, datas):
resp, text = future.result() resp, text = future.result()
if isinstance(resp, BaseException): if isinstance(resp, BaseException):
@@ -176,7 +183,7 @@ def request_callback(future, index, datas):
datas[index]['banner'] = utils.get_sample_banner(headers) datas[index]['banner'] = utils.get_sample_banner(headers)
datas[index]['header'] = json.dumps(dict(headers)) datas[index]['header'] = json.dumps(dict(headers))
history = resp.history history = resp.history
datas[index]['history'] = str(history) datas[index]['history'] = json.dumps(get_jump_urls(history))
if isinstance(text, str): if isinstance(text, str):
title = get_title(text).strip() title = get_title(text).strip()
datas[index]['title'] = utils.remove_invalid_string(title) datas[index]['title'] = utils.remove_invalid_string(title)