[Python] How to access the release-date or -year from an MP3 file with eyed3 in Python

Discussão em 'Python' iniciado por Stack, Maio 13, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to access some MP3 tags like the album release year. It is stored in the id3v2 tags under TYER.

    My platform is Windows 10 Pro.

    I found out that attributes like track_num are located in

    class eyed3.core.Tag

    Then the python command looks like this:

    audiofile = eyed3.load(mp3_file)
    track_num = audiofile.tag.track_num[0]


    Now the year is located in

    class eyed3.core.Date(year,...)

    So I thought that would be:

    year = audiofile.date.year

    But I'm unfortunately wrong. I got an error:


    AttributeError: 'Mp3AudioFile' object has no attribute 'date'
    ​

    Does anyone know how to get the release-date or release-year?

    Or, a more generic question: How can I get all of the available attributes?

    Continue reading...

Compartilhe esta Página