I want to edit mp3tag again

Question
I want to edit mp3tag again. But I couldn’t. I asked this before. I did bellow.



The repl URL is “https://replit.com/@BellRin/mp3tag”.

Shouldn’t you initialize the tags for the file before saving them?

try:
    tags = EasyID3(path)
except ID3NoHeaderError:
    tags = EasyID3()
    tags.add_tags() #like here including this line
    tags.save(path)

Sorry.
I have already solved this problem…
Can you tell me another opportunity?
Thank you for your reply.

If you solve the problem please share what you did to solve it and mark the answer as “Solution”. That way you help others with the same problem!

3 Likes

I changed my code into this code below.

from mutagen.easyid3 import EasyID3
import glob
from mutagen.id3 import ID3NoHeaderError
import os
import shutil

path = input("Enter the path of the song:")

try:
  tags = EasyID3(path)
except ID3NoHeaderError:
  tags = EasyID3()
  tags.save(path)

tags['title'] = input("Enter the title:")
tags['artist'] = input("Enter the artist:")
tags['album'] = input("Enter the album:")
tags.save(path)

print("change completed!")

With this code, I could edit mp3tag.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.