image = Picture()
image.type = 3
if albumart.endswith('png'):
    mime = 'image/png'
else:
    mime = 'image/jpeg'
image.desc = 'front cover'
with open(albumart, 'rb') as f:
    image.data = f.read()
audio.add_picture(image)
audio.save()
mutagen: how to detect and embed album art in mp3, flac and mp4