Python获取URL图片文件的哈希值 hash
pip install Pillow
import hashlib from io import BytesIO def get_hash(file): """ :param bytes file: :return: """ md5hash = hashlib.md5(Image.open(file).tobytes()) return md5hash.hexdigest() url = 'URL' r = requests.get(url, allow_redirects=True, stream=True) print(get_hash(BytesIO(r.content)))