From 5172afed1a62765cf7c7b02e23fcf8c4126715bf Mon Sep 17 00:00:00 2001 From: liuwangsheng01 Date: Wed, 12 Oct 2016 17:20:56 +0800 Subject: [PATCH] change sync url --- test.py | 6 ++++-- wxbot.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test.py b/test.py index dcc034a..342312a 100644 --- a/test.py +++ b/test.py @@ -10,10 +10,12 @@ def handle_msg_all(self, msg): self.send_msg_by_uid(u'hi', msg['user']['id']) self.send_img_msg_by_uid("img/1.png", msg['user']['id']) self.send_file_msg_by_uid("img/1.png", msg['user']['id']) -''' + def schedule(self): self.send_msg(u'测试群', u'测试') -''' + self.send_img_msg_by_uid("img/1.png", self.get_user_id(u"测试群")) + self.send_file_msg_by_uid("img/1.png", self.get_user_id(u"测试群")) + time.sleep(5) def main(): diff --git a/wxbot.py b/wxbot.py index 2cd4cb4..55519c6 100644 --- a/wxbot.py +++ b/wxbot.py @@ -1227,7 +1227,7 @@ def status_notify(self): return dic['BaseResponse']['Ret'] == 0 def test_sync_check(self): - for host in ['webpush', 'webpush2']: + for host in ['webpush.wx', 'webpush2.wx', 'webpush.weixin', 'webpush2.weixin2', ]: self.sync_host = host retcode = self.sync_check()[0] if retcode == '0': @@ -1244,7 +1244,7 @@ def sync_check(self): 'synckey': self.sync_key_str, '_': int(time.time()), } - url = 'https://' + self.sync_host + '.wx.qq.com/cgi-bin/mmwebwx-bin/synccheck?' + urllib.urlencode(params) + url = 'https://' + self.sync_host + '.qq.com/cgi-bin/mmwebwx-bin/synccheck?' + urllib.urlencode(params) try: r = self.session.get(url, timeout=60) r.encoding = 'utf-8'