I get a lot of podcasts that have no ID3 tags in them. I\'ve tried a number of tools that I could use to loop through directories and add title and artist info to the ID3 ta
Mutagen handles this just fine:
>>> import mutagen
>>> from mutagen.easyid3 import EasyID3
>>> filePath = "8049.mp3"
>>> try:
>>> meta = EasyID3(filePath)
>>> except mutagen.id3.ID3NoHeaderError:
>>> meta = mutagen.File(filePath, easy=True)
>>> meta.add_tags()
>>> meta
{}
>>> type(meta)
>>> meta['title'] = "This is a title"
>>> meta['artist'] = "Artist Name"
>>> meta['genre'] = "Space Funk"
>>> meta.save(filePath, v1=2)
>>> changed = EasyID3("8049.mp3")
>>> changed
{'genre': [u'Space Funk'], 'title': [u'This is a title'], 'artist': [u'Artist Name']}