提交 05255c40 编写于 作者: R Roy Xiang 提交者: LittleCoder

retry 'synccheck' if it failed (#417)

上级 6f7d63bd
......@@ -18,6 +18,6 @@
> [您的内容]
[document]: https://github.com/soimort/you-get/wiki/FAQ
[issues]: https://github.com/soimort/you-get/issues
[document]: http://itchat.readthedocs.io/zh/latest/
[issues]: https://github.com/littlecodersh/itchat/issues
[itchatmp]: https://github.com/littlecodersh/itchatmp
......@@ -293,6 +293,7 @@ def sync_check(self):
'_' : int(time.time() * 1000),}
headers = { 'User-Agent' : config.USER_AGENT }
r = self.s.get(url, params=params, headers=headers, timeout=config.TIMEOUT)
r.raise_for_status()
regx = r'window.synccheck={retcode:"(\d+)",selector:"(\d+)"}'
pm = re.search(regx, r.text)
if pm is None or pm.group(1) != '0':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册