Last active
January 3, 2021 19:16
-
-
Save ZachSaucier/f51e608ac75e8ed6e96cd54a9ec103b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, glob, eyed3 | |
os.chdir("./") | |
for file in glob.glob("*.mp3"): | |
filename = os.path.basename(file) | |
if " - " in filename: | |
artist, track = filename.split(' - ') | |
if "".__eq__(track): | |
track = artist | |
artist = "" | |
audiofile = eyed3.load("./" + filename) | |
audiofile.initTag() | |
if not "".__eq__(artist): | |
audiofile.tag.artist = artist | |
audiofile.tag.title = 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