#!/usr/bin/perl # we need to clear out the contents of COMM, TXXX, TXXX01, TXXX02, APIC, GEOB. use MP3::Tag; my $dir = "."; opendir(CWD, $dir) or die "What? \n$!"; my $file = ''; while( defined ( $file = readdir CWD ) ) { chomp $file; next if $name =~ /^\.\.?$/; # . and . if ( ( -f $file ) && ( $file =~ m/mp3$/i ) ) { print "Processing $file:\n"; my $mp3 = MP3::Tag->new($file); $mp3->get_tags; if ( exists $mp3->{ID3v2}) { my $id3v2 = $mp3->{ID3v2}; $id3v2->remove_frame("APIC"); $id3v2->remove_frame("TXXX02"); $id3v2->remove_frame("TXXX01"); $id3v2->remove_frame("TXXX"); $id3v2->remove_frame("GEOB"); $id3v2->remove_frame("COMM"); $id3v2->write_tag(); } } } closedir(CWD);