|
@@ -1121,7 +1121,7 @@ class WXBot:
|
|
|
print '[INFO] Get %d contacts' % len(self.contact_list)
|
|
|
print '[INFO] Start to process messages .'
|
|
|
self.proc_msg()
|
|
|
-
|
|
|
+#第一步:获取uuid
|
|
|
def get_uuid(self):
|
|
|
url = 'https://login.weixin.qq.com/jslogin'
|
|
|
params = {
|
|
@@ -1133,6 +1133,7 @@ class WXBot:
|
|
|
r = self.session.get(url, params=params)
|
|
|
r.encoding = 'utf-8'
|
|
|
data = r.text
|
|
|
+ #window.QRLogin.code = 200; window.QRLogin.uuid = "AfJkWJ4bxg==";
|
|
|
regx = r'window.QRLogin.code = (\d+); window.QRLogin.uuid = "(\S+?)"'
|
|
|
pm = re.search(regx, data)
|
|
|
if pm:
|
|
@@ -1140,7 +1141,7 @@ class WXBot:
|
|
|
self.uuid = pm.group(2)
|
|
|
return code == '200'
|
|
|
return False
|
|
|
-
|
|
|
+#第二步:拼凑二维码链接
|
|
|
def gen_qr_code(self, qr_file_path):
|
|
|
string = 'https://login.weixin.qq.com/l/' + self.uuid
|
|
|
qr = pyqrcode.create(string)
|
|
@@ -1168,6 +1169,7 @@ class WXBot:
|
|
|
408: timeout
|
|
|
tip=0, 等待用户确认登录,
|
|
|
200: confirmed
|
|
|
+ https://login.wx.qq.com/cgi-bin/mmwebwx-bin/login?loginicon=true&uuid=YeCkBn4EEg==&tip=0&r=-301174534&_=1482064866062
|
|
|
"""
|
|
|
LOGIN_TEMPLATE = 'https://login.weixin.qq.com/cgi-bin/mmwebwx-bin/login?tip=%s&uuid=%s&_=%s'
|
|
|
tip = 1
|