Perl Wisdom, iTunes madness


Spotted here, a Perl one-liner to extract album art from an MP3 file (using ID3v2):

perl -MMP3::Info -e '
$file = shift;
$x = get_mp3tag($file, 2, 2);
($i = $x->{PIC}) =~ s/^(....).//;
($e = $1) =~ s/\W//g;
$file =~ s/\.mp3/.$e/;
open $f, ">", $file;
print $f $i;
' song.mp3

Every single Mac geek is going wild over the iTunes cover art feature, and some are using Clutter to automatically retrieve the cover art from Amazon (it stores it in /Library/Images/com.sprote.clutter/CDs).

Some others have found how to invoke specific URLs in the iTunes music store for searching, getting album data, etc, which may pave the way for Sherlock-like web services.


See Also:

Mac