I'm using EasyMP3 from mutagen to add metadata tags to an audio file. But in EasyMP3 the year tag is not defined so I am getting an error saying year is not a valid key.
The following code demonstrates the problem:
from mutagen.mp3 import EasyMP3
tags = EasyMP3('test.mp3')
tags['title'] = 'Some title'
tags['artist'] = 'Some artist'
tags['year'] = '2022'
tags.save()
This is the error:
mutagen.easyid3.EasyID3KeyError: "'year' is not a valid key"
Since I just started using mutagen I don't know much about its other instances. How can I add the year metadata tag to the file?