pythonid3mutageneyed3

mutagen or eyed3: identify and read ID3v1


Most of my MP3 files are tagged with both ID3v1 and ID3v2. I want to write a script to read the files and identify ID3v1 versions, regardless of additional ID3 versions.

I'm struggling with the following code (eyed3). isV1 is only True if ID3v1 is the only used version. But the code prints

V1 > False

V2 > True

for files with ID3v1 and ID3v2.

The code uses eyed3 but I'd also accept mutagen (but could not find an example how to code it).

import eyed3
a = eyed3.load("song.mp3")
print("V1", a.tag.isV1())
print("V2", a.tag.isV2())

Solution

  • Combining that knowledge you have to load the file twice and act upon it:

    v1 = eyed3.load("song.mp3", ID3_V1)
    print("V1", v1.tag.isV1())
    
    v2 = eyed3.load("song.mp3", ID3_V2)
    print("V2", v2.tag.isV2())