PushMe 通知支持自建服务 (#2358)

This commit is contained in:
雨思
2024-05-15 22:38:25 +08:00
committed by GitHub
parent 0b52e05af8
commit 8dd379b6b9
8 changed files with 22 additions and 7 deletions
+6 -2
View File
@@ -101,7 +101,8 @@ push_config = {
'SMTP_PASSWORD': '', # SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定
'SMTP_NAME': '', # SMTP 收发件人姓名,可随意填写
'PUSHME_KEY': '', # PushMe 的 PUSHME_KEY
'PUSHME_KEY': '', # PushMe 的 PUSHME_KEY
'PUSHME_URL': '', # PushMe 的 PUSHME_URL
'CHRONOCAT_QQ': '', # qq号
'CHRONOCAT_TOKEN': '', # CHRONOCAT 的token
@@ -668,10 +669,13 @@ def pushme(title: str, content: str) -> None:
return
print("PushMe 服务启动")
url = f'https://push.i-i.me/?push_key={push_config.get("PUSHME_KEY")}'
url = push_config.get("PUSHME_URL") if push_config.get("PUSHME_URL") else "https://push.i-i.me/"
data = {
"push_key": push_config.get("PUSHME_KEY"),
"title": title,
"content": content,
"date": push_config.get("date") if push_config.get("date") else "",
"type": push_config.get("type") if push_config.get("type") else "",
}
response = requests.post(url, data=data)