Skip to content

Instantly share code, notes, and snippets.

@loderunner
Created November 26, 2015 11:22
from mutagen.easyid3 import EasyID3 as Tag
from os import listdir
from re import sub
for f in listdir('.'):
if (f[-4:] == '.mp3'):
try:
tag = Tag(f)
except:
tag = Tag()
tag['artist'] = 'Steve Miller Band'
tag['album'] = 'Brave New World'
tag['date'] = '1969'
tag['genre'] = 'Rock & Roll'
tag['tracknumber'] = '%02d/%02d' % (int(f[:2]), 9)
# tag['discnumber'] = '%02d/%02d' % (2, 2)
tag['title'] = f[3:-4]
tag.save(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment