nicfit / eyeD3

eyeD3 is a Python module and command line program for processing ID3 tags. Information about mp3 files (i.e bit rate, sample frequency, play time, etc.) is also provided. The formats supported are ID3v1 (1.0/1.1) and ID3v2 (2.3/2.4).
http://eyed3.nicfit.net/
GNU General Public License v3.0
550 stars 59 forks source link

Setting Apple Grouping on MP3s #407

Closed MatthiasHerp closed 4 years ago

MatthiasHerp commented 4 years ago

I tried to use your package to change the Grouping of mp3s. But the Grouping didn't change even though I didn't get an error. Changing the Album Name worked.

My Code: MP3_Tag_Edit.txt

Thansk for the help. Probably a basic thing since I m new to python :)

nicfit commented 4 years ago

audiofile.tag.GRP1 = "Grouptag" is not a thing. Just like GRP1 :) Which is a Apple "extension", so eyeD3 is not really provide any helpers.

This should will work though: audiofile.tag.frame_set[b"GRP1"] = GRP1("GroupName")

GRP1 extends from TextFrame, so there SHOULD only be one frame of this type per tag.

MatthiasHerp commented 4 years ago

@nicfit thanks for the quick response. I tried your code but it didn't work although there was no error message. Is there any other package/subpackage your code would require to run? Since at the moment I only import as follows:

import eyed3 from eyed3.id3 import apple GRP1 = apple.GRP1

Or do you have any other idea?

Otherwise its not such a big deal. I tried your comment and genre changing code examples and it worked without a problem. Since I'm only writing a code to download and automatically sort music, I can also tag tracks by adding special genres or comments.

Thanks a lot for your help :)

nicfit commented 4 years ago

@MatthiasHerp ,indeed. The code I gave adds the GRP1, but not with the right data. Try this:

grp1 = GRP1()
grp1.text = "GroupName123"
audiofile.tag.frame_set[b"GRP1"] = grp1
audiofile.tag.save()

audiofile = eyed3.load("sample.mp3")
print(audiofile.tag.frame_set[b"GRP1"][0].text)

A future release will support the more terse:

audiofile.tag.frame_set[b"GRP1"] = GRP1(text="GroupName123')
MatthiasHerp commented 4 years ago

@nicfit , thanks for the response. I just tried your code and it works :)

This is a great help to my project :) (automated downloader for tracks I save in spotify that adds them in the right iTunes Playlist)