diff --git a/checksendNotify.py b/checksendNotify.py index c6bc7b6..8efed24 100644 --- a/checksendNotify.py +++ b/checksendNotify.py @@ -16,10 +16,11 @@ def message2telegram(tg_api_host, tg_proxy, tg_bot_token, tg_user_id, content): } else: proxies = None - if requests.post(url=url, data=send_data, proxies=proxies) == 200: + try : + requests.post(url=url, data=send_data, proxies=proxies) print("推送成功") return 1 - else: + except: print("推送失败") return 0 @@ -30,4 +31,4 @@ def send(content): tg_bot_token = os.environ.get('TG_BOT_TOKEN') tg_user_id = os.environ.get('TG_USER_ID') message2telegram(tg_api_host=tg_api_host, tg_proxy=tg_proxy, tg_bot_token=tg_bot_token, tg_user_id=tg_user_id, - content=content) + content=content) \ No newline at end of file diff --git a/hlx.py b/hlx.py index 43f58c6..42e7761 100644 --- a/hlx.py +++ b/hlx.py @@ -101,7 +101,7 @@ def start(): if "hlx_username" in os.environ and "hlx_password" in os.environ: print('已经在环境中找到用户名和密码,开始执行程序') res = hlx(os.environ['hlx_username'], os.environ['hlx_password']) - result = f' \'{scriptName}\'' + f' \'{res}\'' + result = f' {scriptName} \n {res}' send(result) else: print('未找到用户名和密码停止执行') diff --git a/wzyd.py b/wzyd.py index a7468a3..fd1405c 100644 --- a/wzyd.py +++ b/wzyd.py @@ -3,7 +3,7 @@ import json import os import time from urllib import parse - +from checksendNotify import send import requests @@ -41,4 +41,4 @@ if __name__ == "__main__": print('王者营地签到开始') text = WZYDCheckIn(check_item=os.environ).main() localtime = time.asctime( time.localtime(time.time()) ) - + send(f'当前时间{localtime}\n结果:{text}')