提交 f89f7c6a 编写于 作者: L LittleCoder

Fix bytes determination bug [BR#289: youfou]

上级 d87da682
build/*
dist/*
test/*
tests/*
itchat.egg-info/*
*.pyc
*.swp
......
import os, platform
VERSION = '1.2.31'
VERSION = '1.2.32'
BASE_URL = 'https://login.weixin.qq.com'
OS = platform.system() #Windows, Linux, Darwin
DIR = os.getcwd()
......
......@@ -134,10 +134,10 @@ def contact_deep_copy(core, contact):
def get_image_postfix(data):
data = data[:20]
if 'GIF' in data:
if b'GIF' in data:
return 'gif'
elif 'PNG' in data:
elif b'PNG' in data:
return 'png'
elif 'JFIF' in data:
elif b'JFIF' in data:
return 'jpg'
return ''
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册