Skip to content

Instantly share code, notes, and snippets.

@gaving
Forked from miyagawa/strip_aac.pl
Created September 16, 2012 16:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaving/3733109 to your computer and use it in GitHub Desktop.
Save gaving/3733109 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