[fix] 修复推送没有url的错误
This commit is contained in:
parent
0a0ce978fd
commit
5b88a83b2b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user