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