I want to write a script that manipulates ID3 tags of mp3 files. I need a tool that reads the tags and outputs it in a format in a machine-readable format. For example, if I want it to output only the title, then it outputs the title, nothing else. I tried different tools like id3 or eyeD3, but they can only be used to write tags or to output them in a human-readable format. Of course I could just filter that output through sed, but it seems unnecessarily complicated to me.
|
|
|||
|
|
|
You could use the
|
|||
|
|
|
|
|||
|
|
|
I would look into the Mutagen tagging library for Python, which includes a basic scriptable command-line tool, mid3v2. While mid3v2's output is primarily human-readable, the
Note this tool only lists ID3 tags, not additional attributes of the MP3 file like exiftool. But if you wanted only a particular tag, a simple grep for the tagname will grab that for you:
If mid3v2 isn't enough for you by itself, and you're comfortable with Python, you could script your own tool to interface with the Mutagen library and read or manipulate the tags directly. |
|||
|
|