Monday, September 10, 2007

Python and ID3 tags

What's a brother gotta do to get a decent MP3 ID3 tag python library.

So i was prepping for ramadan right... i got this "purification of the soul" by imam suhaib lec series and the "code of the scholars: usul al fiqh" by muhammad alshareef one as well... i wanted to put it on my iRiver and iPod so my wife could listen to it.

But the problem is that those pieces of crap go by ID3 tag, not filename (like my handy dandy PDA)... so i set out on a journey to write some code to dynamically populate the ID3 tags on all my mp3s based on the folder/file names ... y'know so that they could run in order and be grouped properly... instead of everything being under the "unititled" artist/album.

So i churn out my python code, and it looked fine. Nothing fancy, simple os.listdir's etc. And i get an ID3 python library -- the first one that pops up on google. Look up the docs, seems straightforward, and i'm on my way.

i wrote all the code, the code did all the tagging, and it was all great

until i put it all in windows media player that is.

it turns out that the library i was using was for ID3 version 1.2 (the first hit for "python id3"), and what's out now is version 2 or 2.3 and that's waht all the media players use, i think even the flash player. So crap, what a waste of time.

I did more googling, but only found out there is no good id3 v2 library. There's one called like ID3v2, but it's crap... its too low level, i don't have time to worry about byte placement stuff. I want simple id3info.title = "hi" kinda stuff.

but yeah, frustrated. What's a brother gotta do to get a good ID3 python library.

Well anyway, i did see an excellent java ID3 library, i think i'll give it a try

1 Comments:

At 12:10 PM, Blogger Unknown said...

Hello Amir, I found this:
http://snipplr.com/view/1624/python--get-id3-from-mp3-file/

Check it out, 11 lines of code and you got what you need.

IDv2 seems like a lame updated specification with things like embedded images and what not so IDv1 should be sufficient.

 

Post a Comment

<< Home