From e44e6a008014ae395267b9d5eff33771a145d532 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 17 Mar 2015 21:12:21 -0400 Subject: [PATCH] id3guess: convert _ to space, allow . after track # --- id3guess | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/id3guess b/id3guess index 5866678..326a5d0 100755 --- a/id3guess +++ b/id3guess @@ -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()