From 9c89f16a43ad0fc9cfb495e00d45209ef9f6384a Mon Sep 17 00:00:00 2001 From: a76yyyy Date: Tue, 18 Jul 2023 08:22:55 +0800 Subject: [PATCH] chore(push): Fix QYWX push fail --- libs/funcs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/funcs.py b/libs/funcs.py index afea806706a..56b3acbaccb 100644 --- a/libs/funcs.py +++ b/libs/funcs.py @@ -318,8 +318,11 @@ async def qywx_pusher_send(self, qywx_token, title:str, log:str): if qywx[u'代理'][-1]!='/': qywx[u'代理'] = qywx[u'代理'] + '/' - if 'http://' in qywx[u'代理'] or 'https://' in qywx[u'代理']: - qywx[u'代理'] = u'https://{0}'.format(qywx[u'代理']) + if qywx[u'代理'][:4] != 'http': + if qywx[u'代理'] == 'qyapi.weixin.qq.com/': + qywx[u'代理'] = u'https://{0}'.format(qywx[u'代理']) + else: + qywx[u'代理'] = u'http://{0}'.format(qywx[u'代理']) get_access_token_res = await self.get_access_token(qywx) pic_url = config.push_pic if qywx[u'图片'] == '' else qywx[u'图片'] if (get_access_token_res.get('access_token','') != '' and get_access_token_res['errmsg'] == 'ok'):