Created
July 16, 2010 21:28
-
-
Save jleedev/478939 to your computer and use it in GitHub Desktop.
Put track numbers in a format that the Sansa Clip doesn't choke on.
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
# Put track numbers in a format that the Sansa Clip doesn't choke on. | |
from mutagen.easyid3 import EasyID3 | |
import sys,re | |
r = re.compile('\d/\d\d') | |
for f in sys.argv[1:]: | |
print f | |
g = EasyID3(f) | |
t = g['tracknumber'][0] | |
if r.match(t): | |
g['tracknumber'] = '0' + t | |
g.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment