From 5b88a83b2b9ec99b5283f7f2371d7524fce742d8 Mon Sep 17 00:00:00 2001 From: yhy0 <1356654790@qq.com> Date: Thu, 29 Jul 2021 18:08:54 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8D=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E6=B2=A1=E6=9C=89url=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- github_cve_monitor.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/github_cve_monitor.py b/github_cve_monitor.py index bd421d3..a7e6845 100644 --- a/github_cve_monitor.py +++ b/github_cve_monitor.py @@ -57,7 +57,8 @@ def get_update_log(url): else: json_str = requests.get(url + '/commits', headers = github_headers, timeout= 10).json() update_log = json_str[0]['commit']['message'] - return update_log, '' + download_url = json_str[0]['html_url'] + return update_log, download_url # 创建md5对象 @@ -200,11 +201,7 @@ def sendNews(tools_list): update_log, download_url = get_update_log(tools_list[i]) tools_name = tools_list[i].split('/')[-1] text = r'** ' + tools_name + r' ** 工具更新啦!' - # body = '' - if download_url != '': - body = "工具名称:" + tools_name + "\r\n" + "工具下载地址:" + download_url + "\r\n" + "工具更新日志:" + update_log - else: - body = "工具名称:" + "\r\n" + "工具更新日志:" + update_log + body = "工具名称:" + tools_name + "\r\n" + "工具地址:" + download_url + "\r\n" + "工具更新日志:" + update_log # 三选一即可,没配置的 注释或者删掉 # server(text, body) dingding(text, body)