This is a program that I hacked together in order to manage my quite massive mp3 collection. Quite often I'll get an entire CD in mp3 format, but the file names will all be in some strange format and the ID3 tags will be a bit off. This program corrects both of those.
It works by pretending that a directory is a physical CD, calculates an ID based off that, and does a
FreeDB∞ lookup on it (the program being called mp3cddb is from before cddb became closed and freedb even existed). If it can't find an entry you can manually enter an ID and Genre to use, gather information from the id3 tags, or start with a blank template. Based on the information recieved it allows you to select among multiple results, edit the information, set the ID3 tags and rename the files as you see fit. I know that there are numerous similar programs in existance, but I like mine (obviously) for being a quick and clean comand-line based interface and having an extremely configurable renaming engine.
Features:
- Supports gathering information from:
- Automatically calculated FreeDB∞ DiscID
- Manually specified FreeDB∞ DiscID and Genre
- ID3 tags of mp3s
- Manual input to blank template
- Simple but powerful regular-expression based renaming engine
- ID3v1 and ID3v2 writing support
- ReadLine support for full text editing with history
- Everything is configurable
Dependencies
(available through
CPAN∞)
- MP3::Info
- MP3::Tag
- CDDB
- Term::ReadLine::Perl or Term::ReadLine::Gnu
Download
mp3cddb-1.6.pl∞
It's just a perl script so `chmod +x` and run it directly or run `perl mp3cddb.pl`.
To Do:
- OGG support
- Windows support ? (it might work, I haven't tested it).
Version History:
- 1.6∞
- Request from 's' to add a --norename option
- 1.5∞
- Add a RENAMEVA that if defined will be used on VA cds instead of the normal RENAME line. Thankes Sven for the patch.
- 1.4∞
- Make the UNDERSCORE option actually do something.
- Allow you to paste a full url from freedb (example∞) and have it parse the genre and id.
- 1.3∞
- Reading information from ID3 tags works with variable artist cds.
- Incorrect DiscID being entered manually no longer results in a crash.
- Add --nocddb option to prevent a network lookup (for renaming based on ID3 tags).
- Directories with [ or ] in their name work correctly
- Files are sorted numerically instead of alphabetically (files named 1,2...9,10 work)
- 1.2∞
- Added support for reading information from ID3 tags.
- 1.0∞
- First version I've stuck online.
Credits
(places I stole code from):
- mp3tocddb.pl by Meng Weng Wong (MPEG::MP3Info)
- mp3tocddb.pl modifications by Andras Bali <drewie@bigfoot.com>
- tagit.pl by Thomas Geffert (MP3::Tag)
Screenshot
since this is a command-line program, a screenshot doesn't make much sense, but here's a sample run:
$ mp3cddb
Working on /Classical/The Planets
searching for discid: 600c8607, total tracks: 7, total time: 3206
.
Here is the only available match:
Artist: Gustav Holst
Title: The Planets, Op. 32
Year: 1994
Genre: Classical
1. Mars, the Bringer of War-Allegro
2. Venus, the Bringer of Peace-Adagio - Andante - Animato - Tempo I
3. Mercury, the Winged Messenger-Vivace
4. Jupiter, the Bringer of Jollity Allegro Giocose
5. Saturn, the Bringer of Old Age-Adagio - Andante
6. Uranus, the Magician-Allegro - Lento - Allegro - Largo
7. Neptune, the Mystic-Andante - Allegretto
Choices: use this match (Y), edit album info (e), edit track listing (t), show example renamed filenames (s), or disregard this album entirely (n)
? s
/Classical/Gustav Holst - 1994 - The Planets, Op. 32/01 - Mars, the Bringer of War-Allegro.mp3
/Classical/Gustav Holst - 1994 - The Planets, Op. 32/02 - Venus, the Bringer of Peace-Adagio - Andante - Animato - Tempo I.mp3
/Classical/Gustav Holst - 1994 - The Planets, Op. 32/03 - Mercury, the Winged Messenger-Vivace.mp3
/Classical/Gustav Holst - 1994 - The Planets, Op. 32/04 - Jupiter, the Bringer of Jollity Allegro Giocose.mp3
/Classical/Gustav Holst - 1994 - The Planets, Op. 32/05 - Saturn, the Bringer of Old Age-Adagio - Andante.mp3
/Classical/Gustav Holst - 1994 - The Planets, Op. 32/06 - Uranus, the Magician-Allegro - Lento - Allegro - Largo.mp3
/Classical/Gustav Holst - 1994 - The Planets, Op. 32/07 - Neptune, the Mystic-Andante - Allegretto.mp3
Choices: use this match (Y), edit album info (e), edit track listing (t), show example renamed filenames (s), or disregard this album entirely (n)
? e
Artist: This is
Title: a test
Make sure this matches the --genres list to be able to write to ID3V1 tags
Genre: where I mess
Year: everything
Comment up
Here is the only available match:
Artist: This is
Title: a test
Year: everything
Genre: where I mess
Comment: up
1. Mars, the Bringer of War-Allegro
2. Venus, the Bringer of Peace-Adagio - Andante - Animato - Tempo I
3. Mercury, the Winged Messenger-Vivace
4. Jupiter, the Bringer of Jollity Allegro Giocose
5. Saturn, the Bringer of Old Age-Adagio - Andante
6. Uranus, the Magician-Allegro - Lento - Allegro - Largo
7. Neptune, the Mystic-Andante - Allegretto
Choices: use this match (Y), edit album info (e), edit track listing (t), show example renamed filenames (s), or disregard this album entirely (n)
? y
Summary of actions:
tagged and renamed /data2/Classical/Holst, Gustav - 1994 - The Planets