diff --git a/config/push.ini.example b/config/push.ini.example index c16a3ed..fc306dd 100644 --- a/config/push.ini.example +++ b/config/push.ini.example @@ -20,4 +20,8 @@ chat_id=123456 #企业微信的appid agentid= secret= -wechat_id= \ No newline at end of file +wechat_id= + +[pushdeer] +api_url=https://api2.pushdeer.com +token= \ No newline at end of file diff --git a/push.py b/push.py index e105ae7..cfc9c6f 100644 --- a/push.py +++ b/push.py @@ -68,7 +68,7 @@ def cq_http(status, push_message): # 企业微信 感谢linjie5492@github -def wecom(status, push_message, wx_push_token=None): +def wecom(status, push_message): secret = cfg.get('wecom', 'secret') wechat_id = cfg.get('wecom', 'wechat_id') push_token = http.post( @@ -84,6 +84,19 @@ def wecom(status, push_message, wx_push_token=None): http.post(f'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={push_token}', json=push_data) +# pushdeer +def pushdeer(status, push_message): + http.get( + url=f'{cfg.get("pushdeer", "api_url")}/message/push', + params={ + "push_key": cfg.get("pushdeer", "token"), + "text": title(status), + "desp": str(push_message).replace("\r\n", "\r\n\r\n"), + "type": "markdown" + } + ) + + def push(status, push_message): if not load_config(): return 0