python - What is the "TPE1" KeyError? -


i'm using mutagen module python artist of various mp3 files have.

here's code giving error:

audio = easyid3(c:\users\owner\music\music\blue Öyster cult\blue Öyster cult\cities on flame) print audio["artist"] 

the code working of mp3 files, there select few continually give following error:

keyerror: 'tpe1'

and because of error, can't see artist. note these mp3 files have artist, , none of them have special characters or that.

why happening? , how can fix it?

thanks

most likely, you're looking key doesn't exist in mutagens id3 dictionary. simple check regular dictionary:

if 'artist' in audio:   print audio['artist'] 

i've tried , without ensuring argument unicode , works in both cases python 2.7.3


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -