renaming horrors
After trying to change the mp3 tags of my (legally purchased) u2 tracks with some gui tools i I reverted to good old working tools: python and find.
a simple "find [uU]2 -type 'f' -exec u2_rename.py \{\} \;" worked like a charm.. way better than all those gui programs. The conversation by itself was rather slow as a new python interpreter instance is started for each found file. It should be rewritten to support the recursive directory traversal by itself but for the sake of simplicity (and the one-shot nature of that program) I’ven’t done that.
the rename program by itself is also very simple:
#!/usr/bin/python
import pyid3lib
import re
import sys
x = pyid3lib.tag(sys.argv[1])
m = re.compile('The complete U2 - ', re.IGNORECASE)
x.origfilename = x.album
x.artist = 'U2'
x.album = m.sub('', x.album)
x.update()
No related posts.
From → Admin-stuff, Desktop-related, Linux