Not too long ago I posted a deal where Rhapsody was letting you download the entire Led Zeppelin collection for $9.99. Sadly the deal is gone, but I’m sure a lot of people took advantage of it and other deals from Rhapsody.
Astute Reddit reader Keck noticed that while the songs are DRM free, they do contain tags pointing to your download info.
The COMM field in the id3v2 tag specified your download ID, but they sneakily also included it in a couple custom fields named TXXX, TXXX01, TXXX02.
Keck put together a down and dirty perl script to strip these tags from your Rhapsody downloads. You can find it here, or at perlhack.com.
#!/usr/bin/perl
use MP3::Tag;
use Data::Dumper;
my $dir = "/path/to/your/mp3s";
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 "$file is an mp3\n"; my $mp3 = MP3::Tag->new($file); $mp3->get_tags; if ( exists $mp3->{ID3v2}) { my $id3v2 = $mp3->{ID3v2}; my $frameIDs_hash = $id3v2->get_frame_ids(); print Dumper $frameIDs_hash; foreach my $frame (keys %$frameIDs_hash) { print "\n############# $frame #############\n"; print Dumper $id3v2->get_frame($frame); } } print "\n"; } } closedir(CWD); Thanks Keck!Technorati Tags: mp3 tags, stripping, perl, hacks, rhapsody, led zeppelin, coding, geek















July 15th, 2008 at 9:58 am
I’m not seeing where it blanks anything, just displays to the screen with Data::Dumper…
You need to actually remove the frames (and take out the silly debug statements like “is an mp3″):
$mp3->remove_frame(”APIC”);
$mp3->remove_frame(”TXXX02?);
$mp3->remove_frame(”TXXX01?);
$mp3->remove_frame(”TXXX”);
$mp3->remove_frame(”GEOB”);
$mp3->remove_frame(”COMM”);
$mp3->write_tag();
IIRC I got that info the other day from a comment on slashdot.
July 15th, 2008 at 10:01 am
I just followed the link and see you posted the second script, which simply verified the first script worked.
July 16th, 2008 at 9:09 am
RevRagnarok:
You are correct; the quick description I wrote up at the url Ben linked to explains this. The one script lists tags so you can customize the tags you want to remove in the 2nd script. It definitely does work