MCPcopy
hub / github.com/liuwons/wxBot / sync_check

Method sync_check

wxbot.py:686–706  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

684 return False
685
686 def sync_check(self):
687 params = {
688 'r': int(time.time()),
689 'sid': self.sid,
690 'uin': self.uin,
691 'skey': self.skey,
692 'deviceid': self.device_id,
693 'synckey': self.sync_key_str,
694 '_': int(time.time()),
695 }
696 url = 'https://' + self.sync_host + '.weixin.qq.com/cgi-bin/mmwebwx-bin/synccheck?' + urllib.urlencode(params)
697 try:
698 r = self.session.get(url)
699 except (ConnectionError, ReadTimeout):
700 return [-1, -1]
701 r.encoding = 'utf-8'
702 data = r.text
703 pm = re.search(r'window.synccheck=\{retcode:"(\d+)",selector:"(\d+)"\}', data)
704 retcode = pm.group(1)
705 selector = pm.group(2)
706 return [retcode, selector]
707
708 def sync(self):
709 url = self.base_uri + '/webwxsync?sid=%s&skey=%s&lang=en_US&pass_ticket=%s' \

Callers 2

proc_msgMethod · 0.95
test_sync_checkMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_sync_checkMethod · 0.76