You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, pretty new'ish to Python, and I had looked at the documentation to try to figure this out.
I couldn't understand how to read the TCOP tag (among other ID3 tags) and write it as blank or remove it. I want to do the same thing to comments and other fields that are unnecessary, but I'm only concerned about doing the copyright (TCOP) tag for the time, because once I figure one out, it'll be easily distributable across other tags I want to change.
Here's the snippet of code I'm having problems with.
defscan_files(): # read the filesforroot, subfolders, files, inos.walk(scan_dir):
fornameinfiles:
# if name.endswith((".mp3", ".m4a", ".flac", ".alac")):ifname.endswith((".mp3")): # only handle mp3's# add track names to a list variabletracks_import_dir.append(name)
# try:globaltrack_mp3globaltrack_id3track_mp3=MP3(root+"\\"+name)
track_id3=ID3(root+"\\"+name)
#tags = ID3(track)classformat_track(): # change various tags# print("")# https://mutagen.readthedocs.io/en/latest/api/id3.html#mutagen.id3.ID3# https://mutagen.readthedocs.io/en/latest/api/mp3.htmldefformat_copyright():
print("Formatting copyright...")
copyright= (track_mp3['TCOP'].text[0])
print(copyright) # Copyright# track_id3 = ID3(track)# print(copyright_tag)format_copyright()
classsave_track: # save track filestrack_mp3.save()
track_id3.save()
# tags.save(track)print(style.color.yellow,
"[INFO] Track saved\n", style.reset)
ifconfig.debug>=3: # print all the tracks to prove they existprint(style.color.yellow,
track_mp3.pprint(), style.reset, "\n")
Under def format_copyright, is a function that when called should set the TCOP tag for my audio files, and class save track: should write those tags.
I was able to get copyright = (track_mp3['TCOP'].text[0]) which prints the copyright tag, to work, but I was unable to figure out a way to write it. I tried for about 4 hours to figure out a method that would work to write it (I had like 100 comments of failed ways of doing this before...)
Dumbed down for me, how can I take track_id3 and/or track_mp3 and write to the TCOP tag "" (to be blank) or remove them entirely?
The text was updated successfully, but these errors were encountered:
Hey, pretty new'ish to Python, and I had looked at the documentation to try to figure this out.
I couldn't understand how to read the TCOP tag (among other ID3 tags) and write it as blank or remove it. I want to do the same thing to comments and other fields that are unnecessary, but I'm only concerned about doing the copyright (TCOP) tag for the time, because once I figure one out, it'll be easily distributable across other tags I want to change.
Here's the snippet of code I'm having problems with.
Under
def format_copyright
, is a function that when called should set the TCOP tag for my audio files, andclass save track:
should write those tags.I was able to get
copyright = (track_mp3['TCOP'].text[0])
which prints the copyright tag, to work, but I was unable to figure out a way to write it. I tried for about 4 hours to figure out a method that would work to write it (I had like 100 comments of failed ways of doing this before...)Dumbed down for me, how can I take
track_id3
and/ortrack_mp3
and write to the TCOP tag""
(to be blank) or remove them entirely?The text was updated successfully, but these errors were encountered: