From bf9c4012f8665d9e864c2d0d19f4dd6514f6499e Mon Sep 17 00:00:00 2001 From: wuyoukm <28343933+wuyoukm@users.noreply.github.com> Date: Mon, 2 Aug 2021 09:42:30 +0800 Subject: [PATCH] Update github_cve_monitor.py --- github_cve_monitor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/github_cve_monitor.py b/github_cve_monitor.py index 7edaac0..0da1eee 100644 --- a/github_cve_monitor.py +++ b/github_cve_monitor.py @@ -31,7 +31,8 @@ def getNews(): cve_total_count = json_str['total_count'] cve_description = json_str['items'][0]['description'] 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: print(e, "github链接不通") @@ -196,7 +197,7 @@ def sendNews(tools_list): # 推送标题 text = r'有新的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) msg = "CVE编号:" + cve_name + "\r\n" + "Github地址:" + str(getNews()[2]) + "\r\n" + "CVE描述:" +"\r\n"+ cve_zh