The following script creates a file of all MP3 files which don't have MP3 tag information. This file can then be passed to another script for further processing.
The script is quick and dirty, is of obvious limited usefulness and could probably be coded more cleanly. However, it works and it works well. I'm just posting it here (1) because once again, Perl has the solution to my problem, and (2) in the hopes that others may find it useful.
Comments and improvements are most welcome.
#!/usr/bin/perl use strict; # only these fields need to be changed @ARGV = qw(/music/mp3/); # where MP3 files are located my $outfile = "$ENV{HOME}/mp3/NoTag"; # where to write the output # nothing below here needs to be changed open (MP3, "> $outfile") || die "can't open MP3: $!"; use File::Find; use MPEG::MP3Info; &File::Find::find(\&check, @ARGV); exit; sub check { if ($File::Find::name !~ /\.mp3$/) { return; } my $tag = get_mp3tag($File::Find::name); if (!($tag)) { # if no id tag, print print MP3 "$File::Find::name\n"; } }
If things get any worse, I'll have to ask you to stop helping me.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Identifying MP3 files with no MP3 tag
by edebill (Scribe) on Jan 02, 2002 at 07:32 UTC | |
Re: Identifying MP3 files with no MP3 tag
by Rich36 (Chaplain) on Jan 02, 2002 at 23:52 UTC | |
by shockme (Chaplain) on Jan 03, 2002 at 00:35 UTC | |
Re: Identifying MP3 files with no MP3 tag
by Kickstart (Pilgrim) on Jan 10, 2002 at 01:09 UTC |