Merge pull request #111 from kokororin/master

添加Bark推送
This commit is contained in:
Womsxd 2022-05-09 11:43:32 +08:00 committed by GitHub
commit 1149b6ae62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -29,3 +29,7 @@ token=
[dingrobot] [dingrobot]
webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX
secret= secret=
[bark]
api_url=https://api.day.app
token=ssXXX

View File

@ -128,6 +128,12 @@ def dingrobot(status, push_message):
).json() ).json()
log.info(f"推送结果:{rep.get('errmsg')}") log.info(f"推送结果:{rep.get('errmsg')}")
# Bark
def bark(status, push_message):
http.get(
url=f'{cfg.get("bark", "api_url")}/{cfg.get("bark", "token")}/{title(status)}/{push_message}'
)
def push(status, push_message): def push(status, push_message):
if not load_config(): if not load_config():
return 0 return 0