Skip to content

Commit

Permalink
fix(push): ex
Browse files Browse the repository at this point in the history
  • Loading branch information
HdShare committed Jul 12, 2024
1 parent 282f655 commit cf5c80d
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/util/PushPlus.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import json
import os
import traceback

import requests


def send(title, content):
requests.post(
"https://www.pushplus.plus/send",
data=json.dumps(
{
"token": os.environ.get("pushplus_token"),
"title": title,
"content": content
}
).encode(encoding="utf-8"),
headers={"Content-Type": "application/json"}
)
try:
requests.post(
"https://www.pushplus.plus/send",
data=json.dumps(
{
"token": os.environ.get("pushplus_token"),
"title": title,
"content": content
}
).encode(encoding="utf-8"),
headers={"Content-Type": "application/json"}
)
except Exception as e:
print(f"推送{title}异常: {e}")
traceback.print_exc()

0 comments on commit cf5c80d

Please sign in to comment.