Skip to content

Instantly share code, notes, and snippets.

@jleedev
Created July 16, 2010 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jleedev/478939 to your computer and use it in GitHub Desktop.
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.
# 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