Skip to content

Instantly share code, notes, and snippets.

@Filirom1
Created January 15, 2015 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Filirom1/006d3ef0ba0ab6076292 to your computer and use it in GitHub Desktop.
Save Filirom1/006d3ef0ba0ab6076292 to your computer and use it in GitHub Desktop.
re-tag mp3
import eyed3
import os
import glob;
for filename in glob.glob('/dir/to/mp3/**/**/*.mp3'):
try:
print(filename)
audiofile = eyed3.load(filename)
audiofile.tag.setTextFrame('TCOM', audiofile.tag.album_artist or audiofile.tag.artist)
print(audiofile.tag.getTextFrame('TCOM'));
audiofile.tag.save()
except:
print("Exception")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment