0

My goal is to use python3 (3.8 preferred) to read and eventually set the comments tag on an MP3 file.

I have installed eyed3 (python3.8 -m pip install eyed3) and the following code will load and can read all the tags, except when it comes to the comments. I've tried reading the documentation from the creator's website (http://eyed3.nicfit.net/) and the GitHub site with no luck and I'm not fully understanding the output from the following code:

import eyed3

music = "/path/to/valid/music/file.mp3"
audio = eyed3.load(music)

print(audio.tag.comments)

this spits out the following:

<eyed3.id3.tag.CommentsAccessor object at 0x7f54ca55d2b0>

I've tried doing a dir(audio.tag.comments) and that doesn't provide anything except a bunch of class bits, and the following functions "get", "remove", "set"         Using something like:

moo = audio.tag.comments.get()

throws an error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mrhobbits/.local/lib/python3.8/site-packages/eyed3/utils/__init__.py", line 138, in wrapped_fn
    return fn(*args, **kwargs)
TypeError: get() missing 1 required positional argument: 'description'

Yet I can't find anything that would show me what 'description' is, or maybe I have to drill deeper to get the comment information?

I should also mention that doing:

print(audio.tag.artist)

works just fine and returns:

Alestorm

I'm a bit lost here. Any help would be great.

M.G.Poirot
  • 1,066
  • 2
  • 11
  • 22
Ryan Barnes
  • 107
  • 1
  • 10

1 Answers1

3

Nevermind,

A quick search here revealed that the 'comments' is a list sort of object, and that doing:

audio.tag.comments[0].text

reveals the information I was looking for.

Ryan Barnes
  • 107
  • 1
  • 10