diff --git a/.gitignore b/.gitignore index 2bffaaa..63059dd 100644 --- a/.gitignore +++ b/.gitignore @@ -138,4 +138,5 @@ dmypy.json config/*.json # push配置 -config/push.ini \ No newline at end of file +config/push.ini +.DS_Store diff --git a/config/README.md b/config/README.md index 004aed4..87bb82c 100644 --- a/config/README.md +++ b/config/README.md @@ -102,7 +102,7 @@ # push.ini配置教程 -* push_server 可选范围 cqhttp ftqq(sever酱) pushplus telegram dingrobot +* push_server 可选范围 cqhttp ftqq(sever酱) pushplus telegram dingrobot bark ## Wecom @@ -150,3 +150,29 @@ webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX secret= ``` + + +## bark + +一款开源的消息推送工具 https://github.com/Finb/Bark + +手机安装bark客户端获得托管在api.day.app的Token,也可以自己搭建私有服务端。 + +**api_url**一般不用改,自己搭建私有服务端的需要改掉 + +**token**填写**APP**内**URL**中的密钥,此选项必填 + +> `https://api.day.app/` `token部分` `/Title/NotificationContent` + +填写示例 + +```ini +[setting] +enable=true +push_server=bark + +[bark] +api_url=https://api.day.app +token=XXX +``` + diff --git a/config/push.ini.example b/config/push.ini.example index bae9d17..466eba4 100644 --- a/config/push.ini.example +++ b/config/push.ini.example @@ -1,6 +1,6 @@ [setting] enable=false -#共有 cqhttp ftqq(sever酱) pushplus telegram wecom dingrobot +#共有 cqhttp ftqq(sever酱) pushplus telegram wecom dingrobot bark push_server=cqhttp #server酱 pushplus dingrobot 的推送token push_token=123456 diff --git a/push.py b/push.py index 3b544d6..25b831a 100644 --- a/push.py +++ b/push.py @@ -139,9 +139,10 @@ def dingrobot(status, push_message): # Bark def bark(status, push_message): - http.get( + rep = http.get( url=f'{cfg.get("bark", "api_url")}/{cfg.get("bark", "token")}/{title(status)}/{push_message}' - ) + ).json() + log.info(f"推送结果:{rep.get('message')}") def push(status, push_message): if not load_config():