Coder Social home page Coder Social logo

un-istore's Introduction

Remove personal information from files acquired from iTunes Store

Since the beginning of times, music was ment to be shared.

But, if you acquired music from iTunes Store, either as a direct buy or through the amazing iTunes Match service, be aware that your M4A files contain personal information.

The proof

Use exiftool to inspect an M4A file:

$ exiftool -UserID -TransactionID -ItemID -AppleStoreCatalogID -AppleStoreAccount -UserName some-itunes-acquired-music-file.m4a
User ID                         : 0x12345678
Transaction ID                  : 0xabcdef98
Item ID                         : 0x34e6b89a
Apple Store Catalog ID          : 9876543210
Apple Store Account             : [email protected]
User Name                       : Avi Alkalay

This is unacceptable.

How to remove this info ?

There is no official music tagger that totally cleans this information. So currently there are 3 ways to clean this mess:

  1. Transcode files to another music format or even to AAC/M4A. This is lossy and unacceptable.
  2. Use ffmpeg in copy mode to rewrite the files without transcoding (lossless), but loosing header info. You'll have to retag your files.
  3. Do the right thing and cirurgicaly delete only the offending bytes on the file's header

The method implemented by the un-istore.sh script is #3.

Simply run it in the root folder of you music. It will recursively seek for all offending M4A files and clean them up. Provide 2 parameters to the script:

  1. Your user name as it appears in the music files. Something like "Your Name".
  2. Your Apple user ID, which is an e-mail address as "[email protected]".

Like this:

$ cd MyMusic
$ un-istore.sh "Avi Alkalay" "[email protected]" | tee -a /tmp/un-istore.log

Try it first on an external copy of your music files, before using it directly on your beloved music collection.

The script works on Linux and might work on macOS too (use your Mac terminal to run it).

The proof it worked

Use exiftool to inspect an M4A file:

$ exiftool -UserID -TransactionID -ItemID -AppleStoreAccount -AppleStoreCatalogID -UserName some-itunes-acquired-music-file.m4a
User ID                         : 0xffffffff
Transaction ID                  : 0xffffffff
Item ID                         : 0x34e6b89a
Apple Store Catalog ID          : 9876543210
Apple Store Account             : iTunes Store
User Name                       : iTunes Store

Compare it with the dirty example above. Catalog ID and Item ID are kept because they are not private information and they help with metadata when sharing music through iMessage.

You can also use the check-istore.sh script to recursively check all your files. It will point you the files that are still dirty. But there will be none. I wrote the check-istore.sh script while developing un-istore.sh to check its effectiveness. It is unneeded anymore but I keep it here for the records.

The magic

The un-istore.sh shell script contains a powerful perl script that cirurgically changes only the 20 or 30 offending bytes on your files. No more, no less. See for yourself the simplicity an powerfulness of its regular expressions.

For the curious: The ffmpeg method (discouraged)

The un-istore.sh script is faster and superior than the ffmpeg in copy mode method documented in this section. But if you are just curious about it, here it is. Use terminal or command line, change directory to the folder containing your iTunes files and paste this:

cd folder/with/M4A/files
mkdir clean;

\ls *m4a | while read f; do
	ffmpeg -i "$f" -acodec copy -vn "clean/$f" < /dev/null;
done

After running this, a cleaned up version of your files will be under clean folder. ffmpeg will completely rewrite your files (forgetting obscure tags as the ones we want to delete) while -acodec copy guarantees a plain copy (and not transcoding) in the audio level. You will loose some of your tags and cover art too, though. So retag your new files after that.

Use un-istore.sh provided in this repository for a faster and more precise fix.

un-istore's People

Contributors

avibrazil avatar fidwj01 avatar nama-mame avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.