Created
November 26, 2015 11:22
-
-
Save loderunner/88ba7e73747cc61c0fbb to your computer and use it in GitHub Desktop.
This file contains 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
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