This commit is contained in:
MasonLiu committed 2025-01-24 17:36:53 +08:00
1 parent 36c9b9beb4
commit 42ad72c0ca
33 files changed
+114 -2260

No files matched your search

+5 -1
View File
@@ -46,7 +46,11 @@ def get_4hou_json():
# 打开并读取JSON文件
with open('./resources/JSON/4hou.json', 'r', encoding='utf-8') as file:
data = json.load(file)
content = file.read()
if not content:
pass
else:
data = json.load(file)
# 假设data是一个包含多个JSON对象的列表
if not isinstance(data, list):
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+11 -5
View File
@@ -35,11 +35,17 @@ def insert_data(data):
def get_anquanke_json():
# 检查文件是否存在
if not os.path.exists('./resources/JSON/anquanke.json'):
raise FileNotFoundError(f"anquanke.json文件不存在,请检查程序是否运行正常!")
# 打开并读取JSON文件
with open('./resources/JSON/anquanke.json', 'r', encoding='utf-8') as file:
data = json.load(file)
data = []
# logger.error(f"anquanke.json文件不存在,请检查爬虫程序是否运行正常!")
print(f"anquanke.json文件不存在,请检查爬虫程序是否运行正常!")
else:
# 打开并读取JSON文件
with open('./resources/JSON/anquanke.json', 'r', encoding='utf-8') as file:
content = file.read()
if not content:
pass
else:
data = json.load(file)
# 假设data是一个包含多个JSON对象的列表
if not isinstance(data, list):
+10 -5
View File
@@ -48,11 +48,16 @@ def insert_data(data):
def get_json():
# 检查文件是否存在
if not os.path.exists('./resources/JSON/baidu.json'):
raise FileNotFoundError("baidu.json文件不存在,请检查程序是否运行正常!")
# 打开并读取JSON文件
with open('./resources/JSON/baidu.json', 'r', encoding='utf-8') as file:
data = json.load(file)
data = []
# logger.error("baidu.json文件不存在,请检查程序是否运行正常!")
else:
# 打开并读取JSON文件
with open('./resources/JSON/baidu.json', 'r', encoding='utf-8') as file:
content = file.read()
if not content:
pass
else:
data = json.load(file)
# 假设data是一个包含多个关键词的字典
total_data = []
+5 -1
View File
@@ -53,7 +53,11 @@ def get_doonsec_json():
# 打开并读取JSON文件
with open('./resources/JSON/doonsec.json', 'r', encoding='utf-8') as file:
data = json.load(file)
content = file.read()
if not content:
pass
else:
data = json.load(file)
# 假设data是一个包含多个JSON对象的列表
if not isinstance(data, list):
+5 -1
View File
@@ -46,7 +46,11 @@ def get_freebuf_json():
# 打开并读取JSON文件
with open('./resources/JSON/freebuf.json', 'r', encoding='utf-8') as file:
data = json.load(file)
content = file.read()
if not content:
pass
else:
data = json.load(file)
# 假设data是一个包含多个JSON对象的列表
if not isinstance(data, list):
+20 -4
View File
@@ -62,28 +62,44 @@ def insert_data():
if not os.path.exists('./resources/JSON/github_keyword.json'):
raise FileNotFoundError(f"github_keyword文件不存在,请检查程序是否运行正常!")
with open('./resources/JSON/github_keyword.json', 'r', encoding='utf-8') as file:
data_keyword = json.load(file)
content = file.read()
if not content:
pass
else:
data_keyword = json.load(file)
if not isinstance(data_keyword, list):
raise ValueError("JSON文件格式错误,请检查爬取程序是否异常!")
if not os.path.exists('./resources/JSON/github_repo.json'):
raise FileNotFoundError(f"github_repo文件不存在,请检查程序是否运行正常!")
with open('./resources/JSON/github_repo.json', 'r', encoding='utf-8') as file:
data_repo = json.load(file)
content = file.read()
if not content:
pass
else:
data_repo = json.load(file)
if not isinstance(data_repo, list):
raise ValueError("JSON文件格式错误,请检查爬取程序是否异常!")
if not os.path.exists('./resources/JSON/github_release.json'):
raise FileNotFoundError(f"github_release文件不存在,请检查程序是否运行正常!")
with open('./resources/JSON/github_release.json', 'r', encoding='utf-8') as file:
data_release = json.load(file)
content = file.read()
if not content:
pass
else:
data_release = json.load(file)
if not isinstance(data_release, list):
raise ValueError("JSON文件格式错误,请检查爬取程序是否异常!")
if not os.path.exists('./resources/JSON/github_user.json'):
raise FileNotFoundError(f"github_user文件不存在,请检查程序是否运行正常!")
with open('./resources/JSON/github_user.json', 'r', encoding='utf-8') as file:
data_user = json.load(file)
content = file.read()
if not content:
pass
else:
data_user = json.load(file)
if not isinstance(data_user, list):
raise ValueError("JSON文件格式错误,请检查爬取程序是否异常!")
+5 -1
View File
@@ -37,7 +37,11 @@ def get_qianxin_json():
# 打开并读取JSON文件
with open('./resources/JSON/qianxin.json', 'r', encoding='utf-8') as file:
data = json.load(file)
content = file.read()
if not content:
pass
else:
data = json.load(file)
# 假设data是一个包含多个JSON对象的列表
if not isinstance(data, list):
+5 -1
View File
@@ -44,7 +44,11 @@ def get_seebug_json():
# 打开并读取JSON文件
with open('./resources/JSON/seebug.json', 'r', encoding='utf-8') as file:
data = json.load(file)
content = file.read()
if not content:
pass
else:
data = json.load(file)
# 假设data是一个包含多个JSON对象的列表
if not isinstance(data, list):
+5 -1
View File
@@ -52,7 +52,11 @@ def get_json():
# 打开并读取JSON文件
with open('./resources/JSON/sougou-wx.json', 'r', encoding='utf-8') as file:
data = json.load(file)
content = file.read()
if not content:
pass
else:
data = json.load(file)
# 假设data是一个包含多个关键词的字典
total_data = []
+5 -1
View File
@@ -45,7 +45,11 @@ def get_xianzhi_json():
# 打开并读取JSON文件
with open('./resources/JSON/xianzhi.json', 'r', encoding='utf-8') as file:
data = json.load(file)
content = file.read()
if not content:
pass
else:
data = json.load(file)
# 假设data是一个包含多个JSON对象的列表
if not isinstance(data, list):