Merge pull request #9 from wuyoukm/master

cve名称BUG修复
This commit is contained in:
yhy 2021-08-02 09:59:45 +08:00 committed by GitHub
commit 8b9bd4a6c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,8 @@ def getNews():
cve_total_count = json_str['total_count'] cve_total_count = json_str['total_count']
cve_description = json_str['items'][0]['description'] cve_description = json_str['items'][0]['description']
cve_url = json_str['items'][0]['html_url'] cve_url = json_str['items'][0]['html_url']
return cve_total_count, cve_description, cve_url cve_name = json_str['items'][0]['name']
return cve_total_count, cve_description, cve_url,cve_name
except Exception as e: except Exception as e:
print(e, "github链接不通") print(e, "github链接不通")
@ -196,7 +197,7 @@ def sendNews(tools_list):
# 推送标题 # 推送标题
text = r'有新的CVE送达' text = r'有新的CVE送达'
# 获取 cve 名字 根据cve 名字,获取描述,并翻译 # 获取 cve 名字 根据cve 名字,获取描述,并翻译
cve_name = re.findall('(CVE\-\d+\-\d+)', req['items'][0]['name'])[0].upper() cve_name = re.findall('(CVE\-\d+\-\d+)', getNews()[3])[0].upper()
cve_zh = get_cve_des_zh(cve_name) cve_zh = get_cve_des_zh(cve_name)
msg = "CVE编号" + cve_name + "\r\n" + "Github地址" + str(getNews()[2]) + "\r\n" + "CVE描述" +"\r\n"+ cve_zh msg = "CVE编号" + cve_name + "\r\n" + "Github地址" + str(getNews()[2]) + "\r\n" + "CVE描述" +"\r\n"+ cve_zh
@ -280,4 +281,5 @@ if __name__ == '__main__':
"https://api.github.com/repos/L-codes/Neo-reGeorg", "https://api.github.com/repos/L-codes/Neo-reGeorg",
"https://api.github.com/repos/shadow1ng/fscan", "https://api.github.com/repos/shadow1ng/fscan",
] ]
sendNews(tools_list) sendNews(tools_list)