We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Update code in itchat/components/messages.py
itchat/components/messages.py
elif m['MsgType'] == 49: # sharing if m['AppMsgType'] == 6: rawMsg = m cookiesList = {name:data for name,data in core.s.cookies.items()} url = core.loginInfo['fileUrl'] + '/webwxgetmedia' params = { 'sender': rawMsg['FromUserName'], 'mediaid': rawMsg['MediaId'], 'filename': rawMsg['FileName'], 'fromuser': core.loginInfo['wxuin'], 'pass_ticket': 'undefined', 'webwx_data_ticket': cookiesList['webwx_data_ticket'],} headers = { 'User-Agent' : config.USER_AGENT } def download_atta(attaDir=None): r = core.s.get(url, params=params, stream=True, headers=headers) tempStorage = io.BytesIO() for block in r.iter_content(1024): tempStorage.write(block) if attaDir is None: return tempStorage.getvalue() with open(attaDir, 'wb') as f: f.write(tempStorage.getvalue()) return ReturnValue({'BaseResponse': { 'ErrMsg': 'Successfully downloaded', 'Ret': 0, }}) msg = { 'Type': 'Attachment', 'Text': download_atta, }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Fix: Update code in
itchat/components/messages.py
The text was updated successfully, but these errors were encountered: