按pr要求修改

This commit is contained in:
qiaoyun680 2024-10-23 08:07:37 +00:00
parent 510fad7ab6
commit 02c469a7be
2 changed files with 8 additions and 3 deletions

View File

@ -302,10 +302,14 @@ def serverJ(title: str, content: str) -> None:
print("serverJ 服务启动") print("serverJ 服务启动")
data = {"text": title, "desp": content.replace("\n", "\n\n")} data = {"text": title, "desp": content.replace("\n", "\n\n")}
if push_config.get("PUSH_KEY").startswith("sctp"):
url = f'https://{push_config.get("PUSH_KEY")}.push.ft07.com/send' match = re.match(r'sctp(\d+)t', push_config.get("PUSH_KEY"))
if match:
num = match.group(1)
url = f'https://{num}.push.ft07.com/send/{push_config.get("PUSH_KEY")}.send'
else: else:
url = f'https://sctapi.ftqq.com/{push_config.get("PUSH_KEY")}.send' url = f'https://sctapi.ftqq.com/{push_config.get("PUSH_KEY")}.send'
response = requests.post(url, data=data).json() response = requests.post(url, data=data).json()
if response.get("errno") == 0 or response.get("code") == 0: if response.get("errno") == 0 or response.get("code") == 0:
@ -780,6 +784,7 @@ def chronocat(title: str, content: str) -> None:
else: else:
print(f"QQ群消息:{ids}推送失败!") print(f"QQ群消息:{ids}推送失败!")
def ntfy(title: str, content: str) -> None: def ntfy(title: str, content: str) -> None:
""" """
通过 Ntfy 推送消息 通过 Ntfy 推送消息