【发布时间】:2020-03-10 14:45:09
【问题描述】:
我正在尝试使用枕头下载图像,然后将该图像提供给 eyed3 以用作专辑封面,但出现以下错误:
TypeError: can't concat JpegImageFile to bytes
response = requests.get(album_art_url)
img = Image.open(BytesIO(response.content))
audiofile = eyed3.load(f"{self.current_song_name}-{self.current_song_url}.mp3")
audiofile.tag.images.set(type_=3, img_data=img,
mime_type="image/jpeg",
description=None,
img_url=None)
audiofile.tag.save()
【问题讨论】:
-
错误出现在哪一行?
-
您将 PIL/Pillow 图像作为
img_data传递。您只需传递构成图像的 URL 或字节...根据我找到的文档...eyed3.readthedocs.io/en/latest/_modules/eyed3/id3/tag.html
标签: python python-imaging-library eyed3