iTunes Plus & Personal Info

October 4, 2010

iTunes Plus is awesome, however there’s one thing that hasn’t been discussed much - namely that the purchased songs are all laced with the customer’s personal information (such as their full name and Apple ID). I do think this is a good way to fight piracy but does present some problems in the event of the files leaking from the machine.

This isn’t totally new, some guys made a tool to strip the info, way back in 2007. The EFF then noticed that it did not get rid of all the personal info. You’d think that the info just lives in some standard metadata fields, something you could easily wipe with AtomicParsley but unfortunately that’s not the case. I think what Apple did was break the MPEG4 file spec a bit by putting both content and structure inside one of the topmost atoms. When you delete the atom that contains this personal info, you end up wiping some important data rendering the file unusable and a law-abiding metadata editor cannot just edit the contents while preserving child nodes.

Anyways, I wanted to see how close I could get to a totally “clean” iTunes Plus file without losing the important metadata, so I threw together a small Bash wrapper for AtomicParsley:

fullname=$(dscl . read /Users/${USER} RealName | tail -n 1)
fullname=$(echo ${fullname#\b})
replace=$(printf "%${#fullname}s")

AtomicParsley "$1" \
  --manualAtomRemove "moov.udta.meta.ilst.apID" \
  --manualAtomRemove "moov.udta.meta.ilst.cnID" \
  --manualAtomRemove "moov.udta.meta.ilst.atID" \
  --manualAtomRemove "moov.udta.meta.ilst.plID" \
  --manualAtomRemove "moov.udta.meta.ilst.geID" \
  --manualAtomRemove "moov.udta.meta.ilst.sfID" \
  --manualAtomRemove "moov.udta.meta.ilst.akID" \
  --manualAtomRemove "moov.udta.meta.ilst.purd" \
  --manualAtomRemove "moov.udta.meta.ilst.----.name:[iTunNORM]" \
  --manualAtomRemove "moov.udta.meta.ilst.----.name:[iTunSMPB]" \
  --manualAtomRemove "moov.udta.meta.ilst.----.name:[iTunMOVI]" \
  --output "$2"

if [[ $? ]]; then
  sed -i '' "s/${fullname}/${replace}/" "$2"
fi

You can download a more complete version of the script from here. Notice that I am assuming the songs were purchased by the same person who’s currently logged in and that AP is installed and in your PATH.

If I understand correctly this little snippet should give you the same level of “privacy” as Privatunes, while being easier to run onto entire folders. This is far from any sort of elegant solution, but it’ll have to do for now…

Also available as an AppleScript droplet. Just drag any number of files onto the thing and choose a destination folder.