-
Notifications
You must be signed in to change notification settings - Fork 10
/
Metadata Notes.txt
231 lines (201 loc) · 9.93 KB
/
Metadata Notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
Metadata Notes
==============
mediainfo can show file info and metadata tags. But it can't write metadata. Atomic Parsley can show and write metadata, but can't show file info. So I'll continue to use mediainfo for file info, and use Atomic Parsley for all metadata reading and writing.
Format of a line of Atomic Parsley, using '-t':
Atom "©alb" contains: Monk, Season 7
This is not too hard to parse:
1) Split on ':' --> array
2) Split array[0] on ' ' --> atomArray
3) remove first and last char from atomArray[1] --> atom
4) remove leading and trailing whitespace from array[1] --> value
'atom' and 'value' are then used. There is a special format used for iTunes specific atoms:
Atom "----" [com.apple.iTunes;iTunEXTC] contains: us-tv|TV-PG|400|
Parse the same way, but add:
5) if atomArray[2] starts with '[' then
a) atomArray[2] --> atom
Format of value is usually string. But if atom is '[com.apple.iTunes;iTunEXTC]' then we parse further:
6) if atom == '[com.apple.iTunes;iTunEXTC]' then
a) split value on '|' --> valueArray
b) valueArray[1] --> value
Most values are strings. Some are numbers (e.g., 'tvsn', tvep') and others are dates in UTC format:
Atom "©day" contains: 2008-07-18T07:00:00Z
and the artwork tells you how many images there are:
Atom "covr" contains: 1 piece of artwork
Artwork can then be extracted with:
AtomicParsley <file> -e <path/basename>
then the tmp dir will have <basename>_artwork_<n>.jpg for each image
Atomic Parsley can deal with these tags:
--artist , -a (str) Set the artist tag: "moov.udta.meta.ilst.©ART.data"
--title , -s (str) Set the title tag: "moov.udta.meta.ilst.©nam.data"
--album , -b (str) Set the album tag: "moov.udta.meta.ilst.©alb.data"
--genre , -g (str) Set the genre tag: "©gen" (custom) or "gnre" (standard).
see the standard list with "AtomicParsley --genre-list"
--tracknum , -k (num)[/tot] Set the track number (or track number & total tracks).
--disk , -d (num)[/tot] Set the disk number (or disk number & total disks).
--comment , -c (str) Set the comment tag: "moov.udta.meta.ilst.©cmt.data"
--year , -y (num|UTC) Set the year tag: "moov.udta.meta.ilst.©day.data"
set with UTC "2006-09-11T09:00:00Z" for Release Date
--lyrics , -l (str) Set the lyrics tag: "moov.udta.meta.ilst.©lyr.data"
--composer , -w (str) Set the composer tag: "moov.udta.meta.ilst.©wrt.data"
--copyright , -x (str) Set the copyright tag: "moov.udta.meta.ilst.cprt.data"
--grouping , -G (str) Set the grouping tag: "moov.udta.meta.ilst.©grp.data"
--artwork , -A (/path) Set a piece of artwork (jpeg or png) on "covr.data"
Note: multiple pieces are allowed with more --artwork args
--bpm , -B (num) Set the tempo/bpm tag: "moov.udta.meta.ilst.tmpo.data"
--albumArtist , -A (str) Set the album artist tag: "moov.udta.meta.ilst.aART.data"
--compilation , -C (bool) Sets the "cpil" atom (true or false to delete the atom)
--advisory , -y (1of3) Sets the iTunes lyrics advisory ('remove', 'clean', 'explicit')
--stik , -S (1of7) Sets the iTunes "stik" atom (--stik "remove" to delete)
"Movie", "Normal", "TV Show" .... others:
see the full list with "AtomicParsley --stik-list"
or set in an integer value with --stik value=(num)
Note: --stik Audiobook will change file extension to '.m4b'
--description , -p (str) Sets the description on the "desc" atom
--TVNetwork , -n (str) Sets the TV Network name on the "tvnn" atom
--TVShowName , -H (str) Sets the TV Show name on the "tvsh" atom
--TVEpisode , -I (str) Sets the TV Episode on "tven":"209", but its a string: "209 Part 1"
--TVSeasonNum , -U (num) Sets the TV Season number on the "tvsn" atom
--TVEpisodeNum , -N (num) Sets the TV Episode number on the "tves" atom
--podcastFlag , -f (bool) Sets the podcast flag (values are "true" or "false")
--category , -q (str) Sets the podcast category; typically a duplicate of its genre
--keyword , -K (str) Sets the podcast keyword; invisible to MacOSX Spotlight
--podcastURL , -L (URL) Set the podcast feed URL on the "purl" atom
--podcastGUID , -J (URL) Set the episode's URL tag on the "egid" atom
--purchaseDate , -D (UTC) Set Universal Coordinated Time of purchase on a "purd" atom
(use "timestamp" to set UTC to now; can be akin to id3v2 TDTG tag)
--encodingTool , (str) Set the name of the encoder on the "©too" atom
--gapless , (bool) Sets the gapless playback flag for a track in a gapless album
--contentRating , (str) Sets the content rating (adds the region info, etc. automatically)
Info we are currently showing in Metadata panel:
Name [©nam]
Show (Series Title) [tvsh]
Production # [tven]
Episode [tves]
Season [tvsn]
Track # of # [trkn]
Disc # of # [disk]
Description [desc]
Release date Y M D [©day]
Media Kind (Movie, TV Show, etc.) [stik]
Content Rating [com.apple.iTunes;iTunEXTC]
Rating Annotation (from [com.apple.iTunes;iTunEXTC])
Content Advisory [rtng]
Artwork [covr]
Comments [©cmt]
Album [©alb]
Artist [©ART]
Album Artist [aART]
Copyright Notice [cprt]
Network [tvnn]
Encoding Tool [©too]
Genre [gnre] or [©gen]
Accessing Metadata Services
===========================
API Keys
--------
TheMovieDB.org: ae6c3dcf41e60014a3d0508e7f650884
TheTVDB.com: 75D1299AD9C7876E
TVDB Interface
--------------
1) Hit: http://www.thetvdb.com/api/75D1299AD9C7876E/mirrors.xml returned XML has <mirrorpath> element. Use that as url
2) Parse filename
a) Look for S<season>E<episode>
b) Takes anything before this as 'seriesName'
c) Put <season> into 'season' and <episode> into 'episode'
d) Replace '_' or '.' in 'seriesName with ' '
3) Hit http://www.thetvdb.com/api/GetSeries.php?seriesname=<seriesName> (see example below)
4) If only one hit, skip 5
5) Get all <SeriesName> elements into an array, present to user for selection
6) Get contents of selected <seriesid> into 'seriesid'
7) Hit http://www.thetvdb.com/data/series/<seriesid>/all/ for XML of all episodes (see example below)
8) Search through <Episode> results trying to match <SeasonNumber> to 'season' and <EpisodeNumber> to 'episode'
9) If not found present all seasons and episodes in pulldowns for selection
10) Extract metadata (shown above) from selected episode
11) Present metadata to user
Sample TVDB search result:
<Data>
<Series>
<seriesid>82493</seriesid>
<language>en</language>
<SeriesName>iCarly</SeriesName>
<banner>graphical/82493-g.jpg</banner>
<Overview>
Carly is a teenager who lives with her twenty-six year old brother and guardian Spencer,
and produces her own web casts from a studio she constructed in the attic of her home.
She does this because she isn't looking for fame or fortune, but just because she wants
to be a good role model for kids and teens. "iCarly" makes TV history as the first series
to incorporate kid-generated original content into its script.
</Overview>
<FirstAired>2007-09-08</FirstAired>
<id>82493</id>
</Series>
</Data>
Sample TVDB series result:
<?xml version="1.0" encoding="UTF-8" ?>
<Data><Series>
<id>82493</id>
<Actors>|Miranda Cosgrove|</Actors>
<Airs_DayOfWeek></Airs_DayOfWeek>
<Airs_Time></Airs_Time>
<ContentRating>TV-Y7</ContentRating>
<FirstAired>2007-09-08</FirstAired>
<Genre>|Children|Comedy|</Genre>
<IMDB_ID></IMDB_ID>
<Language>en</Language>
<Network>Nickelodeon</Network>
<NetworkID></NetworkID>
<Overview>
Carly is a teenager who lives with her twenty-six year old brother and guardian Spencer,
and produces her own web casts from a studio she constructed in the attic of her home.
She does this because she isn't looking for fame or fortune, but just because she wants
to be a good role model for kids and teens. "iCarly" makes TV history as the
first series to incorporate kid-generated original content into its script.
</Overview>
<Rating></Rating>
<Runtime>30</Runtime>
<SeriesID>71399</SeriesID>
<SeriesName>iCarly</SeriesName>
<Status>Continuing</Status>
<added></added>
<addedBy></addedBy>
<banner>graphical/82493-g.jpg</banner>
<fanart>fanart/original/82493-2.jpg</fanart>
<lastupdated>1238914021</lastupdated>
<poster></poster>
<zap2it_id></zap2it_id>
</Series>
<Episode>
<id>375316</id>
<Combined_episodenumber>1</Combined_episodenumber>
<Combined_season>0</Combined_season>
<DVD_chapter></DVD_chapter>
<DVD_discid></DVD_discid>
<DVD_episodenumber></DVD_episodenumber>
<DVD_season></DVD_season>
<Director></Director>
<EpImgFlag></EpImgFlag>
<EpisodeName>iCarly Saves TV</EpisodeName>
<EpisodeNumber>1</EpisodeNumber>
<FirstAired>2008-06-13</FirstAired>
<GuestStars>Mary Scheer (Mrs. Benson), Rachel Fox (Amber Tate), Sammi Hanratty (Morgan), Leon Thomas (Harper)</GuestStars>
<IMDB_ID></IMDB_ID>
<Language>en</Language>
<Overview>
TV producers want to turn iCarly into a hit TV show, and 100% fame wouldn't be a problem
for Carly, Sam, and Freddie. But is it really what they expected?
</Overview>
<ProductionCode></ProductionCode>
<Rating></Rating>
<SeasonNumber>0</SeasonNumber>
<Writer></Writer>
<absolute_number></absolute_number>
<airsafter_season></airsafter_season>
<airsbefore_episode></airsbefore_episode>
<airsbefore_season></airsbefore_season>
<filename></filename>
<lastupdated>1216185914</lastupdated>
<seasonid>33660</seasonid>
<seriesid>82493</seriesid>
</Episode>
...
</Data>