Skip to content

Instantly share code, notes, and snippets.

@miyagawa
Created May 3, 2012 19:03
Show Gist options
  • Save miyagawa/2588271 to your computer and use it in GitHub Desktop.
Save miyagawa/2588271 to your computer and use it in GitHub Desktop.
Strip iTunes purchase metadata from DRM-free AAC files
#!/usr/bin/env perl
use strict;
use File::Find::Rule;
use Capture::Tiny qw(capture);
sub atomic {
my($file, @cmd) = @_;
capture {
system "atomicparsley", $file, @cmd;
};
}
my @files = File::Find::Rule->file->name('*.m4a')->in("$ENV{HOME}/Music/iTunes");
for my $file (@files) {
if (atomic($file, '-t') =~ /apID/) {
warn "Stripping Apple metadata from $file\n";
warn atomic($file, "--manualAtomRemove", "moov.udta.meta.ilst.apID", "--manualAtomRemove", "moov.udta.meta.ilst.purd", "-W");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment