获取用户头像:
import itchat, shutil
itchat.auto_login(True)
r = itchat.get_head_img(picDir='tmp.unknown')
print(r)
if 'PostFix' in r:
shutil.move('tmp.unknown', 'tmp.%s' % r['PostFix'])
获取聊天图片:
import itchat, shutil
itchat.auto_login(True)
@itchat.msg_register(itchat.content.PICTURE)
def download(msg):
r = msg['Text']('tmp.unknown')
print(r)
if 'PostFix' in r:
shutil.move('tmp.unknown', 'tmp.%s' % r['PostFix'])
itchat.run()