From 06d78e34b66aed60d1dcf5a09052141f2ed13287 Mon Sep 17 00:00:00 2001 From: PianCat <50688679+PianCat@users.noreply.github.com> Date: Sun, 5 Jan 2025 14:06:09 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Server=20=E9=85=B1?= =?UTF-8?q?=E7=9A=84=E9=80=9A=E7=9F=A5=E6=B8=A0=E9=81=93=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E9=80=82=E9=85=8D=E6=9C=80=E6=96=B0=E7=9A=84=20Server?= =?UTF-8?q?=20=E9=85=B1=C2=B3=20=E7=9A=84=E9=80=9A=E7=9F=A5=E6=B8=A0?= =?UTF-8?q?=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/funcs.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libs/funcs.py b/libs/funcs.py index efaf4eb5290..2151b7738c8 100644 --- a/libs/funcs.py +++ b/libs/funcs.py @@ -8,6 +8,7 @@ import random import time import traceback +import re import aiohttp import croniter @@ -134,7 +135,14 @@ async def send2s(self, skey: str, title: str, content: str): r = 'False' if skey != "": try: - link = f"https://sctapi.ftqq.com/{skey.replace('.send', '')}.send" + match = re.match(r'^sctp(\d+)t', skey) + + if match: + sc3uid = match.group(1) + link = f"https://{sc3uid}.push.ft07.com/send/{skey.replace('.send', '')}.send?tags=QD" + else: + link = f"https://sctapi.ftqq.com/{skey.replace('.send', '')}.send" + content = content.replace('\\r\\n', '\n\n') d = {'text': title, 'desp': content} async with aiohttp.ClientSession(conn_timeout=config.connect_timeout) as session: @@ -147,6 +155,7 @@ async def send2s(self, skey: str, title: str, content: str): return e return r + async def send2tg(self, tg_token, title, content): r = 'False' tmp = tg_token.split(';')