Timur Izhbulatov — Independent Electronic Music

Editing ID3 tags with Python and Mutagen

Thu, 01 Feb 2007 in Tech stuff | permalink

id3 mutagen python tagging

Recently I've stumbled upon some MP3 files containing no tags. I tried to tag these files using Quodlibet but it appeared to be impossible. After a breif investigation of the problem I found out that it's just raw MPEG Layer III streams with no proper ID3 headers. In order to fix this I decided to write a Python script.

The script adds empty ID3 header to raw MPEG Layer III streams using mutagen. Mutagen is a Python library to handle audio metadata. After running this script on a directory tree containing *.mp3 files you can use Quodlibet to edit tags.