Commit 9e2baa4f authored by Yaowentong's avatar Yaowentong

fix

parent c161fbd6
......@@ -32,6 +32,10 @@ def qianwen_android_process_original_data(file_path):
data_str = i.split("data:")[1]
json_data = json.loads(data_str)
#
# print('----')
# print('----')
except (IndexError, json.JSONDecodeError):
continue
......@@ -70,6 +74,10 @@ def qianwen_android_process_original_data(file_path):
if isinstance(search_list, list):
for search in search_list:
search_keyword.append(search.get('query'))
if mime_type == 'bar/progress' and meta_data_type == 'bar_update':
if messages[0].get('meta_data'):
if messages[0].get('meta_data').get('elements'):
response_content+=messages[0].get('meta_data').get('elements')[0].get('content')
# 引用来源-无下标
if mime_type == 'bar/iframe' and status == 'complete':
if meta_data:
......@@ -195,7 +203,6 @@ def qianwen_android_process_original_data(file_path):
if isinstance(paas, list):
for pa in paas:
suggestions.append(pa.get('show_text'))
if url_list_batch:
url_list = url_list_batch
spider_save_tos.process_and_save_files(file_path, search_keyword, url_list, think_content, response_content,
......@@ -227,6 +234,6 @@ def qianwen_android_process_original_data(file_path):
if __name__ == '__main__':
file_path2 = 'geo/7e3eb418-83ee-44ca-b6cf-ea4c3af9aae2/TYQWA/original.text'
file_path2 = 'geo/e7b374d8-60c3-4658-98a2-64c72b6c521b/TYQWA/original.text'
# file_path2 = 'geo/ef586bf6-55d8-4e2a-8fb0-5fd1beb5bf7c/TYQWA/original.text'
qianwen_android_process_original_data(file_path2)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment