id3guess: convert _ to space, allow . after track #

This commit is contained in:
Josh Holtrop 2015-03-17 21:12:21 -04:00
parent 8942044aee
commit e44e6a0080

View File

@ -13,8 +13,9 @@ sys.stdout.write('Year: ')
year = sys.stdin.readline().strip()
for f in sorted(os.listdir('.')):
m = re.match('(\d+)\s(.*)\.mp3', f, re.I)
m = re.match('(\d+)[\s.](.*)\.mp3', f, re.I)
if m is not None:
track, title = m.group(1, 2)
title = re.sub(r'_', ' ', title)
sys.stdout.write('%s: Track "%s", Title "%s"\n' % (f, track, title))
Popen(['id3tag', '-a', artist, '-A', album, '-y', year, '-t', track, '-s', title, f]).wait()