提交 d42f0f46 编写于 作者: L LittleCoder

Avoid failure in login of accounts with big contact & make qrcode bigger

上级 ff35f6fd
......@@ -254,7 +254,11 @@ def get_contact(self, update=False):
headers = {
'ContentType': 'application/json; charset=UTF-8',
'User-Agent' : config.USER_AGENT, }
r = self.s.get(url, headers=headers)
try:
r = self.s.get(url, headers=headers)
except:
logger.info('Failed to fetch contact, that may because of the amount of your chatrooms')
return []
tempList = json.loads(r.content.decode('utf-8', 'replace'))['MemberList']
chatroomList, otherList = [], []
for m in tempList:
......@@ -350,7 +354,8 @@ def get_head_img(self, userName=None, chatroomUserName=None, picDir=None):
'''
params = {
'userName': userName or chatroomUserName or self.storageClass.userName,
'skey': self.loginInfo['skey'], }
'skey': self.loginInfo['skey'],
'type': 'big', }
url = '%s/webwxgeticon' % self.loginInfo['url']
if chatroomUserName is None:
infoDict = self.storageClass.search_friends(userName=userName)
......
......@@ -84,7 +84,7 @@ def get_QR(self, uuid=None, enableCmdQR=False, picDir=None, qrCallback=None):
picDir = picDir or config.DEFAULT_QR
qrStorage = io.BytesIO()
qrCode = QRCode('https://login.weixin.qq.com/l/' + uuid)
qrCode.png(qrStorage)
qrCode.png(qrStorage, scale=10)
if hasattr(qrCallback, '__call__'):
qrCallback(uuid=uuid, status='0', qrcode=qrStorage.getvalue())
else:
......
import os, platform
VERSION = '1.2.24'
VERSION = '1.2.25'
BASE_URL = 'https://login.weixin.qq.com'
OS = platform.system() #Windows, Linux, Darwin
DIR = os.getcwd()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册