Skip to content

Commit

Permalink
Merge pull request liuwons#136 from vivre90/patch-4
Browse files Browse the repository at this point in the history
修复1102,0和-1,-1的问题
  • Loading branch information
liuwons authored Oct 12, 2016
2 parents c949109 + b60084e commit fd47c0d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions wxbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,9 +1116,12 @@ 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.wx2','webpush.weixin', 'webpush2.weixin2']:
self.sync_host = host
retcode = self.sync_check()[0]
try:
retcode = self.sync_check()[0]
except:
retcode == -1
if retcode == '0':
return True
return False
Expand All @@ -1133,7 +1136,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'
Expand Down

0 comments on commit fd47c0d

Please sign in to comment.