Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ZachSaucier/f51e608ac75e8ed6e96cd54a9ec103b0 to your computer and use it in GitHub Desktop.

Select an option

Save ZachSaucier/f51e608ac75e8ed6e96cd54a9ec103b0 to your computer and use it in GitHub Desktop.
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("utf-8")
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