I'd like to be able to add album cover into the file using mutagen, however when I add it as a file it returns with:
File "D:\Download\pandora\renamingMETAEFF.pyw", line 71, in <module> meta['covr'] = image File "C:\Users\AMD\AppData\Local\Programs\Python\Python35\lib\site-packages\mutagen\_file.py", line 67, in __setitem__ self.tags[key] = value File "C:\Users\AMD\AppData\Local\Programs\Python\Python35\lib\site-packages\mutagen\mp4\__init__.py", line 357, in __setitem__ self._render(key, value) File "C:\Users\AMD\AppData\Local\Programs\Python\Python35\lib\site-packages\mutagen\mp4\__init__.py", line 371, in _render return render_func(self, key, value) File "C:\Users\AMD\AppData\Local\Programs\Python\Python35\lib\site-packages\mutagen\mp4\__init__.py", line 732, in __render_cover b"data", struct.pack(">2I", imageformat, 0) + cover)) TypeError: can't concat bytes to str
The relevant piece of code is this:
from mutagen.mp4 import MP4
image = jpgname + '.jpg'
meta['\xa9nam'] = song
meta['\xa9ART'] = artist
meta['\xa9alb'] = album
meta = MP4(songPath)
meta['covr'] = image
meta.save()
The rest of the metadata works perfectly fine, however the image part completely breaks the whole code.