pushDeer支持自架版

This commit is contained in:
whyour
2022-11-20 20:05:02 +08:00
parent 8b8336d9d0
commit 6f185570d6
7 changed files with 24 additions and 7 deletions
+4
View File
@@ -61,6 +61,7 @@ push_config = {
'PUSH_KEY': '', # server 酱的 PUSH_KEY,兼容旧版与 Turbo 版
'DEER_KEY': '', # PushDeer 的 PUSHDEER_KEY
'DEER_URL': '', # PushDeer 的 PUSHDEER_URL
'CHAT_URL': '', # synology chat url
'CHAT_TOKEN': '', # synology chat token
@@ -280,6 +281,9 @@ def pushdeer(title: str, content: str) -> None:
print("PushDeer 服务启动")
data = {"text": title, "desp": content, "type": "markdown", "pushkey": push_config.get("DEER_KEY")}
url = 'https://api2.pushdeer.com/message/push'
if push_config.get("DEER_URL"):
url = push_config.get("DEER_URL")
response = requests.post(url, data=data).json()
if len(response.get("content").get("result")) > 0: