Skip to content

Commit 906a49d

Browse files
authored
Merge pull request liuwons#136 from vivre90/patch-4
修复1102,0和-1,-1的问题
2 parents e56c9d4 + facc336 commit 906a49d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

wxbot.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,9 +1116,12 @@ def status_notify(self):
11161116
return dic['BaseResponse']['Ret'] == 0
11171117

11181118
def test_sync_check(self):
1119-
for host in ['webpush', 'webpush2']:
1119+
for host in ['webpush.wx', 'webpush2.wx2','webpush.weixin', 'webpush2.weixin2']:
11201120
self.sync_host = host
1121-
retcode = self.sync_check()[0]
1121+
try:
1122+
retcode = self.sync_check()[0]
1123+
except:
1124+
retcode == -1
11221125
if retcode == '0':
11231126
return True
11241127
return False
@@ -1133,7 +1136,7 @@ def sync_check(self):
11331136
'synckey': self.sync_key_str,
11341137
'_': int(time.time()),
11351138
}
1136-
url = 'https://' + self.sync_host + '.wx.qq.com/cgi-bin/mmwebwx-bin/synccheck?' + urllib.urlencode(params)
1139+
url = 'https://' + self.sync_host + '.qq.com/cgi-bin/mmwebwx-bin/synccheck?' + urllib.urlencode(params)
11371140
try:
11381141
r = self.session.get(url, timeout=60)
11391142
r.encoding = 'utf-8'

0 commit comments

Comments
 (0)