Skip to content

Commit 9c89f16

Browse files
committed
chore(push): Fix QYWX push fail
1 parent 1a4f896 commit 9c89f16

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libs/funcs.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,11 @@ async def qywx_pusher_send(self, qywx_token, title:str, log:str):
318318

319319
if qywx[u'代理'][-1]!='/':
320320
qywx[u'代理'] = qywx[u'代理'] + '/'
321-
if 'http://' in qywx[u'代理'] or 'https://' in qywx[u'代理']:
322-
qywx[u'代理'] = u'https://{0}'.format(qywx[u'代理'])
321+
if qywx[u'代理'][:4] != 'http':
322+
if qywx[u'代理'] == 'qyapi.weixin.qq.com/':
323+
qywx[u'代理'] = u'https://{0}'.format(qywx[u'代理'])
324+
else:
325+
qywx[u'代理'] = u'http://{0}'.format(qywx[u'代理'])
323326
get_access_token_res = await self.get_access_token(qywx)
324327
pic_url = config.push_pic if qywx[u'图片'] == '' else qywx[u'图片']
325328
if (get_access_token_res.get('access_token','') != '' and get_access_token_res['errmsg'] == 'ok'):

0 commit comments

Comments
 (0)