Reading ID3v2.3 MP3 tags in Mutagen

278 views
Skip to first unread message

expr...@gmail.com

unread,
Aug 23, 2014, 3:10:57 PM8/23/14
to quod-libet-...@googlegroups.com
I've tried using Mutagen's ID3, EasyID3, and MP3 modules for reading ID3 tags, and I can only read the artist, album, etc tags in ID3v1 files -- not files which contain ID3v2.3 or a combination of both.

My code (tries all three methods):

    mp3 = MP3(path, ID3=EasyID3)
    print(mp3.pprint())
    print()
   
    audio = ID3(path)
    print(audio)
    print()
   
    easy = EasyID3(path)
    print(easy)

For an ID3v1 file, all three methods would give me the desired information, but for a ID3v2.3 file, this would produce the output

"MPEG 2 layer 3, 96000 bps, 22050 Hz, 378.47 seconds (audio/mp3)

{}

{}"

Any idea what I'm doing wrong?

expr...@gmail.com

unread,
Aug 28, 2014, 9:33:51 PM8/28/14
to quod-libet-...@googlegroups.com
I've still had no luck doing this, and no information seems to be out there on the net on how to do it right. Loading ID3v2.3 seems like it should be something Mutagen can do easily, but it's simply not working.

David Gasaway

unread,
Aug 28, 2014, 11:22:25 PM8/28/14
to quod-libet-...@googlegroups.com
Works for me (python 2.7.8, mutagen 1.22, file with ID3v2.3 tags):

[dave@nymph Tracks]$ python2
Python 2.7.8 (default, Aug 21 2014, 10:14:24)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mutagen.id3
>>> afile = mutagen.id3.ID3('Verdi, Giuseppe - I Lombardi - La mia letizia infondere (Corelli).mp3')
>>> print(afile)
{u'TXXX:WORK': TXXX(encoding=1, desc=u'WORK', text=[u'I Lombardi alla
prima Crociata, 1843']), 'TPE1': TPE1(encoding=1, text=[u'Giuseppe
Verdi']), 'TEXT': TEXT(encoding=1, text=[u'Temistocle Solera']),
'TALB': TALB(encoding=1, text=[u'The Early Recordings']),
u'TXXX:LYRICISTSORT': TXXX(encoding=1, desc=u'LYRICISTSORT',
text=[u'Solera, Temistocle']), 'TSOP': TSOP(encoding=1, text=[u'Verdi,
Giuseppe']), 'TRCK': TRCK(encoding=0, text=[u'01']),
u'TXXX:PERFORMER': TXXX(encoding=1, desc=u'PERFORMER', text=[u'Franco
Corelli']), 'TIT2': TIT2(encoding=1, text=[u'I Lombardi alla prima
Crociata, 1843: "La mia letizia infondere"']), u'TXXX:PART':
TXXX(encoding=1, desc=u'PART', text=[u'"La mia letizia infondere"']),
'TCON': TCON(encoding=1, text=[u'Opera']), u'TXXX:COMPOSERSORT':
TXXX(encoding=1, desc=u'COMPOSERSORT', text=[u'Verdi, Giuseppe']),
u'TXXX:PERFORMERSORT': TXXX(encoding=1, desc=u'PERFORMERSORT',
text=[u'Corelli, Franco']), 'TCOM': TCOM(encoding=1, text=[u'Giuseppe
Verdi'])}
>>> quit()
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Quod Libet Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to quod-libet-develo...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
-:-:- David K. Gasaway
-:-:- Email: da...@gasaway.org

Christoph Reiter

unread,
Aug 29, 2014, 4:50:01 AM8/29/14
to quod-libet-...@googlegroups.com, expr...@gmail.com
On Fri, Aug 29, 2014 at 3:33 AM, <expr...@gmail.com> wrote:
> I've still had no luck doing this, and no information seems to be out there
> on the net on how to do it right. Loading ID3v2.3 seems like it should be
> something Mutagen can do easily, but it's simply not working.

It should work, yes. Please open a bug report and attach a sample file
at https://bitbucket.org/lazka/mutagen/issues/new

Or send me the file per mail/dropbox etc.

expr...@gmail.com

unread,
Aug 29, 2014, 8:32:22 AM8/29/14
to quod-libet-...@googlegroups.com, expr...@gmail.com
Update: Everything works fine when using Python 2.7. It does not work on Python 3.3.3. My setup method was "python3.3 setup.py install" (with python3.3 set up to refer to my 3.3 install).

I also tried it on a fresh install of the latest Python 3 version, 3.4.1, and I get the same problems.

I submitted a bug report.

Christoph Reiter

unread,
Aug 29, 2014, 10:17:19 AM8/29/14
to quod-libet-...@googlegroups.com, expr...@gmail.com
On Fri, Aug 29, 2014 at 2:32 PM, <expr...@gmail.com> wrote:
> Update: Everything works fine when using Python 2.7. It does not work on
> Python 3.3.3. My setup method was "python3.3 setup.py install" (with
> python3.3 set up to refer to my 3.3 install).
>
> I also tried it on a fresh install of the latest Python 3 version, 3.4.1,
> and I get the same problems.

mutagen currently doesn't support Python 3

> I submitted a bug report.

Thanks

expr...@gmail.com

unread,
Aug 29, 2014, 10:27:56 AM8/29/14
to quod-libet-...@googlegroups.com, expr...@gmail.com
Ok, that explains it. Hopefully it will be updated to support Python 3 at some point.
Reply all
Reply to author
Forward
0 new messages