More Apple TV metadata fun
Written on 4/2/2007
I spent a little more time with Atomic Parsley. It’s a pretty useful command-line tool for setting metadata on Apple TV videos, but there are a few things that are a little bit opaque. I’ll document what I’ve learned so far.
Seeing all your metadata
First, download the latest version of Atomic Parsely.
Now, let’s see all the metadata you can see on a file. To get all the metadata for a file, just add -t to the end. (Note: I changed a couple of the fields that might hold personal info about my iTunes account.)
% atomicparsley Pirates\ of\ the\ Caribbean_\ The\ Curse\ of\ the\ Black\ Pearl.m4v -t
Atom "----" [com.apple.iTunes;tool] contains: 12345678901234567
Atom “©nam” contains: Pirates of the Caribbean: The Curse of the Black Pearl
Atom “©gen” contains: Action & Adventure
Atom “©day” contains: 2003-07-09T07:00:00Z
Atom “pgap” contains: false
Atom “apID” contains: youraccountname@mac.com
Atom “cprt” contains: ℗ Disney 2006
Atom “cnID” contains: 187698805
Atom “rtng” contains: Inoffensive
Atom “atID” contains: 0
Atom “geID” contains: 4401
Atom “sfID” contains: United States (143441)
Atom “akID” contains: 0
Atom “desc” contains: From producer Jerry Bruckheimer (PEARL HARBOR) comes PIRATES OF THE CARIBBEAN: THE CURSE OF THE BLACK PEARL, the thrilling high-seas adventure with a mysterious twist. The roguish yet charming Captain Jack Sparrow’s (Academy Award (R) Nominee Johnny Depp)
Atom “stik” contains: Short Film
Atom “purd” contains: 2006-09-15 04:00:20
Atom “—-” [com.apple.iTunes;iTunEXTC] contains: mpaa|PG-13|300|For action/adventure violence.
Atom “—-” [com.apple.iTunes;iTunMOVI] contains: <?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
<plist version=”1.0″>
<dict>
<key>cast</key>
<array>
<dict>
<key>adamId</key>
<integer>15506997</integer>
<key>name</key>
<string>Johnny Depp</string>
</dict>
<dict>
<key>adamId</key>
<integer>187698859</integer>
<key>name</key>
<string>Geoffrey Rush</string>
</dict>
<dict>
<key>adamId</key>
<integer>187698862</integer>
<key>name</key>
<string>Orlando Bloom</string>
</dict>
<dict>
<key>adamId</key>
<integer>187698850</integer>
<key>name</key>
<string>Keira Knightley</string>
</dict>
<dict>
<key>adamId</key>
<integer>92228270</integer>
<key>name</key>
<string>Jack Davenport</string>
</dict>
</array>
<key>directors</key>
<array>
<dict>
<key>adamId</key>
<integer>187698865</integer>
<key>name</key>
<string>Gore Verbinski</string>
</dict>
</array>
<key>producers</key>
<array>
<dict>
<key>adamId</key>
<integer>187499677</integer>
<key>name</key>
<string>Jerry Bruckheimer</string>
</dict>
</array>
</dict>
</plist>
Atom “covr” contains: 1 piece of artwork
Ok, so from looking at this we can see that the description is easy enough to get to, but the actors, director, and producer are all embedded in a plist inside the metadata. That doesn’t look too easy to manipulate. The adamId is apparently a unique identifier the iTunes store uses to identify each person, probably so you can click on their names in iTunes and get to more information about that person. I’ll revisit that data in a bit, but for now the easy stuff. Just to make the lines shorter I’ll make the filename simply Pirates.m4v from now on. Note that the command can sometimes take a long time on big files because Atomic Parsley needs to make room in the file for the metadata by shifting the data section over.
Set the description
atomicparsley Pirates.m4v --description “This is a description. It can be up to 255 characters long and it will truncate if it is longer than that.”
Set the rating
atomicparsley --contentRating “PG-13”
where rating is one of TV-MA, TV-14, TV-PG, TV-G, TV-Y, TV-Y7, Unrated, NC-17, R, PG-13, PG, G . Ratings for other countries are more complicated. See the atomic parsley forums for more detail.
Set all TV Episode data
Here’s an example of how to set every useful piece of metadata for a TV show. This is a real example using all the metadata on an iTunes-purchased episode of BSG.
atomicparsley Example.m4v --title “Battlestar Galactica” --album “Battlestar Galactica, Season 3” --artist “Battlestar Galactica” --genre “Science Fiction” --tracknum 15 --description “Chief Tyrol’s inner labor leader leads him to defy Adama and become the rallying point for a strike.” --TVNetwork “NBC Universal” --TVShowName “Battlestar Galactica” --TVEpisode T2715 --TVSeasonNum 3 --TVEpisodeNum 15 --stik “TV Show” -art /users/yourname/desktop/art.jpg
Set all Movie data
Here’s an example using Pirates of the Caribbean and setting all useful metadata.
atomicparsley Pirates.m4v --title “Pirates of the Caribbean: The Curse of the Black Pearl” --genre “Action & Adventure” --description “From producer Jerry Bruckheimer (PEARL HARBOR) comes PIRATES OF THE CARIBBEAN: THE CURSE OF THE BLACK PEARL, the thrilling high-seas adventure with a mysterious twist. The roguish yet charming Captain Jack Sparrow’s (Academy Award (R) Nominee Johnny Depp)” --stik “Short Film” --contentRating “PG-13” -art /users/yourname/desktop/art.jpg
After all that for a movie file, we’re still missing two things. We haven’t yet attacked the Actor, Producer, Director fields, and there is an information button on iTunes-purchased movies that we don’t see on home-made movies. It looks like this:
Setting this is a bit harder, you’ll need to make a plain text file, all one line, something like this:
atompic--rDNSatom “< ?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
Really this is beyond the scope of what I’m writing up today. If you want to mess with this I suggest you wait for someone to write a tool that allows you to manipulate it.
Ok, so one last thing. Setting the cast and director above enabled the Information button in iTunes, but we don’t see the description when we click, just an empty box. It turns out that that box uses something called the long description, which is different than the normal description field. Atomic Parsley can’t reach that data, but we can copy it using AppleScript. I’ll work on that for the next post.
Many thanks to the Atomic Parsley author and other contributors over at the Sourceforge forums, who provided a lot of good info in their posts.

Check out the scripts at Doug’s Applescripts for iTunes. There is a script in there for long description that would at least solve that problem.