Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import os, glob, eyed3
os.chdir("./")
for file in glob.glob("*.mp3"):
filename = os.path.basename(file)
if " - " in filename:
artist, track = filename.split(' - ')
audiofile = eyed3.load("./" + filename)
audiofile.initTag()
audiofile.tag.artist = unicode(artist)
audiofile.tag.title = unicode(track.split('.mp3')[0])
audiofile.tag.save()
os.rename(filename, track)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.