RSS

Rhapsody MP3s contain personal data in tags. Here’s a quick perl script to remove those.

Mon, Jul 14, 2008

ArsGeek

Talk about it in our Forums

Rhapsody MP3s contain personal data in tags. Here’s a quick perl script to remove those.

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: , , , , , , ,

Click the icon, share the link:
  • Digg
  • del.icio.us
  • MisterWong
  • Furl
  • Reddit
  • Technorati
  • BlinkList
  • feedmelinks
  • PopCurrent
  • Blogosphere News
  • Facebook
  • Fark
  • Mixx
  • Slashdot
, , , , , , ,

This post was written by:

arsgeek - who has written 1980 posts on ArsGeek.


Contact the author

3 Comments For This Post

  1. RevRagnarok Says:

    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.

  2. RevRagnarok Says:

    I just followed the link and see you posted the second script, which simply verified the first script worked.

  3. keck Says:

    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 :)

4 Trackbacks For This Post

  1. Strip Identifying Info from Rhapsody MP3s [How To] Says:

    [...] tag editor—including the collection-organizing free app MediaMonkey, can likely do the job. Rhapsody MP3s contain personal data in tags. Here’s a quick perl script to remove those. [...]

  2. Strip Identifying Info from Rhapsody MP3s [How To] : Colossal Technology Concepts Says:

    [...] tag editor—including the collection-organizing free app MediaMonkey, can likely do the job. Rhapsody MP3s contain personal data in tags. Here’s a quick perl script to remove those. [...]

  3. Life Clerks » Strip Identifying Info from Rhapsody MP3s [How To] Says:

    [...] tag editor—including the collection-organizing free app MediaMonkey, can likely do the job. Rhapsody MP3s contain personal data in tags. Here’s a quick perl script to remove those. [...]

  4. Remove Identifying Information from Rhapsody MP3s Says:

    [...] it is also possible to use a small perl script to get rid of the tags. The Reddit user Keck (via Arsgeek) published it on Reddit and everyone can copy and paste the script from his Reddit user page. [...]

Leave a Reply