From 22704334fea3bc4cca71041c1c63236a0c63818f Mon Sep 17 00:00:00 2001 From: ngfchl Date: Thu, 9 Feb 2023 21:50:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BC=81=E4=B8=9A=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E4=BB=A3=E7=90=86=E6=9C=8D=E5=8A=A1=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt_site/UtilityTool.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pt_site/UtilityTool.py b/pt_site/UtilityTool.py index 25baec3..983dfc8 100644 --- a/pt_site/UtilityTool.py +++ b/pt_site/UtilityTool.py @@ -25,13 +25,13 @@ from lxml import etree from pypushdeer import PushDeer from requests import Response, ReadTimeout from urllib3.exceptions import NewConnectionError, ConnectTimeoutError -from wechat_push import WechatPush from wxpusher import WxPusher from auto_pt.models import Notify, OCR from pt_site.models import MySite, SignIn, TorrentInfo, SiteStatus, Site from ptools.base import TorrentBaseInfo, PushConfig, CommonResponse, StatusCodeEnum, DownloaderCategory from ptools.settings import BASE_DIR +from wechat_push import WechatPush urllib3.util.ssl_.DEFAULT_CIPHERS = 'ALL' @@ -137,7 +137,9 @@ class PtSpider: notify_push = WechatPush( corp_id=notify.corpid, secret=notify.corpsecret, - agent_id=notify.agentid, ) + agent_id=notify.agentid, + server=notify.custom_server + ) res = notify_push.send_text( text=message, to_uid=notify.touser if notify.touser else '@all' @@ -2469,8 +2471,7 @@ class PtSpider: @staticmethod def parse_token(cmd): - with open('db/ptools.toml', 'r') as f: - data = toml.load(f) + data = toml.load('db/ptools.toml') return CommonResponse.success( data=data.get(cmd) )