9 from datetime
import datetime
10 from xml
.dom
import minidom
11 from xml
.parsers
import expat
18 from lrucache
import LRUCache
21 import plugins
.video
.transcode
25 TRIBUNE_CR
= ' Copyright Tribune Media Services, Inc.'
27 TV_RATINGS
= {'TV-Y7': 1, 'TV-Y': 2, 'TV-G': 3, 'TV-PG': 4, 'TV-14': 5,
28 'TV-MA': 6, 'TV-NR': 7, 'TVY7': 1, 'TVY': 2, 'TVG': 3,
29 'TVPG': 4, 'TV14': 5, 'TVMA': 6, 'TVNR': 7, 'Y7': 1,
30 'Y': 2, 'G': 3, 'PG': 4, '14': 5, 'MA': 6, 'NR': 7,
31 'UNRATED': 7, 'X1': 1, 'X2': 2, 'X3': 3, 'X4': 4, 'X5': 5,
34 MPAA_RATINGS
= {'G': 1, 'PG': 2, 'PG-13': 3, 'PG13': 3, 'R': 4, 'X': 5,
35 'NC-17': 6, 'NC17': 6, 'NR': 8, 'UNRATED': 8, 'G1': 1,
36 'P2': 2, 'P3': 3, 'R4': 4, 'X5': 5, 'N6': 6, 'N8': 8}
38 STAR_RATINGS
= {'1': 1, '1.5': 2, '2': 3, '2.5': 4, '3': 5, '3.5': 6,
39 '4': 7, '*': 1, '**': 3, '***': 5, '****': 7, 'X1': 1,
40 'X2': 2, 'X3': 3, 'X4': 4, 'X5': 5, 'X6': 6, 'X7': 7}
42 HUMAN
= {'mpaaRating': {1: 'G', 2: 'PG', 3: 'PG-13', 4: 'R', 5: 'X',
44 'tvRating': {1: 'Y7', 2: 'Y', 3: 'G', 4: 'PG', 5: '14',
46 'starRating': {1: '1', 2: '1.5', 3: '2', 4: '2.5', 5: '3',
48 'colorCode': {1: 'B & W', 2: 'COLOR AND B & W',
49 3: 'COLORIZED', 4: 'COLOR'}
58 tivo_cache
= LRUCache(50)
59 mp4_cache
= LRUCache(50)
60 dvrms_cache
= LRUCache(50)
61 nfo_cache
= LRUCache(50)
63 mswindows
= (sys
.platform
== "win32")
66 return HUMAN
['mpaaRating'].get(rating
, 'NR')
69 return HUMAN
['tvRating'].get(rating
, 'NR')
71 def get_stars(rating
):
72 return HUMAN
['starRating'].get(rating
, '')
75 return HUMAN
['colorCode'].get(value
, 'COLOR')
80 tsize
= '%.2f GB' % (raw
/ GB
)
82 tsize
= '%.2f MB' % (raw
/ MB
)
84 tsize
= '%.2f KB' % (raw
/ KB
)
86 tsize
= '%d Bytes' % raw
89 def tag_data(element
, tag
):
90 for name
in tag
.split('/'):
92 for new_element
in element
.childNodes
:
93 if new_element
.nodeName
== name
:
99 if not element
.firstChild
:
101 return element
.firstChild
.data
103 def _vtag_data(element
, tag
):
104 for name
in tag
.split('/'):
105 new_element
= element
.getElementsByTagName(name
)
108 element
= new_element
[0]
109 elements
= element
.getElementsByTagName('element')
110 return [x
.firstChild
.data
for x
in elements
if x
.firstChild
]
112 def _vtag_data_alternate(element
, tag
):
114 for name
in tag
.split('/'):
116 for elmt
in elements
:
117 new_elements
+= elmt
.getElementsByTagName(name
)
118 elements
= new_elements
119 return [x
.firstChild
.data
for x
in elements
if x
.firstChild
]
121 def _tag_value(element
, tag
):
122 item
= element
.getElementsByTagName(tag
)
124 value
= item
[0].attributes
['value'].value
127 def from_moov(full_path
):
128 if full_path
in mp4_cache
:
129 return mp4_cache
[full_path
]
135 mp4meta
= mutagen
.File(unicode(full_path
, 'utf-8'))
138 mp4_cache
[full_path
] = {}
141 # The following 1-to-1 correspondence of atoms to pyTivo
142 # variables is TV-biased
143 keys
= {'tvnn': 'callsign',
144 'tvsh': 'seriesTitle'}
146 if 'stik' in mp4meta
:
147 isTVShow
= (mp4meta
['stik'] == mutagen
.mp4
.MediaKind
.TV_SHOW
)
149 isTVShow
= 'tvsh' in mp4meta
150 for key
, value
in mp4meta
.items():
151 if type(value
) == list:
154 metadata
[keys
[key
]] = value
156 #could be programId (EP, SH, or MV) or "SnEn"
157 if value
.startswith('SH'):
158 metadata
['isEpisode'] = 'false'
159 elif value
.startswith('MV') or value
.startswith('EP'):
160 metadata
['isEpisode'] = 'true'
161 metadata
['programId'] = value
162 elif key
.startswith('S') and key
.count('E') == 1:
163 epstart
= key
.find('E')
164 seasonstr
= key
[1:epstart
]
165 episodestr
= key
[epstart
+1:]
166 if (seasonstr
.isdigit() and episodestr
.isdigit()):
167 if len(episodestr
) < 2:
168 episodestr
= '0' + episodestr
169 metadata
['episodeNumber'] = seasonstr
+episodestr
171 #put together tvsn and tves to make episodeNumber
174 if 'tves' in mp4meta
:
175 tvesValue
= mp4meta
['tves']
176 if type(tvesValue
) == list:
177 tvesValue
= tvesValue
[0]
178 tves
= str(tvesValue
)
181 metadata
['episodeNumber'] = tvsn
+tves
182 # These keys begin with the copyright symbol \xA9
183 elif key
== '\xa9day':
186 value
+= '-01-01T16:00:00Z'
187 metadata
['originalAirDate'] = value
190 metadata
['movieYear'] = value
[:4]
191 #metadata['time'] = value
192 elif key
in ['\xa9gen', 'gnre']:
193 for k
in ('vProgramGenre', 'vSeriesGenre'):
195 metadata
[k
].append(value
)
197 metadata
[k
] = [value
]
198 elif key
== '\xa9nam':
200 metadata
['episodeTitle'] = value
202 metadata
['title'] = value
204 # Description in desc, cmt, and/or ldes tags. Keep the longest.
205 elif key
in ['desc', '\xa9cmt', 'ldes'] and len(value
) > len_desc
:
206 metadata
['description'] = value
207 len_desc
= len(value
)
209 # A common custom "reverse DNS format" tag
210 elif (key
== '----:com.apple.iTunes:iTunEXTC' and
211 ('us-tv' in value
or 'mpaa' in value
)):
212 rating
= value
.split("|")[1].upper()
213 if rating
in TV_RATINGS
and 'us-tv' in value
:
214 metadata
['tvRating'] = TV_RATINGS
[rating
]
215 elif rating
in MPAA_RATINGS
and 'mpaa' in value
:
216 metadata
['mpaaRating'] = MPAA_RATINGS
[rating
]
218 # Actors, directors, producers, AND screenwriters may be in a long
219 # embedded XML plist.
220 elif (key
== '----:com.apple.iTunes:iTunMOVI' and
221 'plistlib' in sys
.modules
):
222 items
= {'cast': 'vActor', 'directors': 'vDirector',
223 'producers': 'vProducer', 'screenwriters': 'vWriter'}
225 data
= plistlib
.readPlistFromString(value
)
231 metadata
[items
[item
]] = [x
['name'] for x
in data
[item
]]
232 elif (key
== '----:com.pyTivo.pyTivo:tiVoINFO' and
233 'plistlib' in sys
.modules
):
235 data
= plistlib
.readPlistFromString(value
)
240 metadata
[item
] = data
[item
]
242 mp4_cache
[full_path
] = metadata
245 def from_mscore(rawmeta
):
247 keys
= {'title': ['Title'],
248 'description': ['Description', 'WM/SubTitleDescription'],
249 'episodeTitle': ['WM/SubTitle'],
250 'callsign': ['WM/MediaStationCallSign'],
251 'displayMajorNumber': ['WM/MediaOriginalChannel'],
252 'originalAirDate': ['WM/MediaOriginalBroadcastDateTime'],
253 'rating': ['WM/ParentalRating'],
254 'credits': ['WM/MediaCredits'], 'genre': ['WM/Genre']}
257 for tag
in keys
[tagname
]:
260 value
= rawmeta
[tag
][0]
261 if type(value
) not in (str, unicode):
264 metadata
[tagname
] = value
268 if 'episodeTitle' in metadata
and 'title' in metadata
:
269 metadata
['seriesTitle'] = metadata
['title']
270 if 'genre' in metadata
:
271 value
= metadata
['genre'].split(',')
272 metadata
['vProgramGenre'] = value
273 metadata
['vSeriesGenre'] = value
274 del metadata
['genre']
275 if 'credits' in metadata
:
276 value
= [x
.split('/') for x
in metadata
['credits'].split(';')]
278 metadata
['vActor'] = [x
for x
in (value
[0] + value
[3]) if x
]
279 metadata
['vDirector'] = [x
for x
in value
[1] if x
]
280 del metadata
['credits']
281 if 'rating' in metadata
:
282 rating
= metadata
['rating']
283 if rating
in TV_RATINGS
:
284 metadata
['tvRating'] = TV_RATINGS
[rating
]
285 del metadata
['rating']
289 def from_dvrms(full_path
):
290 if full_path
in dvrms_cache
:
291 return dvrms_cache
[full_path
]
294 rawmeta
= mutagen
.File(unicode(full_path
, 'utf-8'))
297 dvrms_cache
[full_path
] = {}
300 metadata
= from_mscore(rawmeta
)
301 dvrms_cache
[full_path
] = metadata
304 def from_eyetv(full_path
):
305 keys
= {'TITLE': 'title', 'SUBTITLE': 'episodeTitle',
306 'DESCRIPTION': 'description', 'YEAR': 'movieYear',
307 'EPISODENUM': 'episodeNumber'}
309 path
= os
.path
.dirname(unicode(full_path
, 'utf-8'))
310 eyetvp
= [x
for x
in os
.listdir(path
) if x
.endswith('.eyetvp')][0]
311 eyetvp
= os
.path
.join(path
, eyetvp
)
313 eyetv
= plistlib
.readPlist(eyetvp
)
316 if 'epg info' in eyetv
:
317 info
= eyetv
['epg info']
320 metadata
[keys
[key
]] = info
[key
]
322 metadata
['seriesTitle'] = info
['TITLE']
324 metadata
['vActor'] = [x
.strip() for x
in info
['ACTORS'].split(',')]
326 metadata
['vDirector'] = [info
['DIRECTOR']]
328 for ptag
, etag
, ratings
in [('tvRating', 'TV_RATING', TV_RATINGS
),
329 ('mpaaRating', 'MPAA_RATING', MPAA_RATINGS
),
330 ('starRating', 'STAR_RATING', STAR_RATINGS
)]:
331 x
= info
[etag
].upper()
332 if x
and x
in ratings
:
333 metadata
[ptag
] = ratings
[x
]
335 # movieYear must be set for the mpaa/star ratings to work
336 if (('mpaaRating' in metadata
or 'starRating' in metadata
) and
337 'movieYear' not in metadata
):
338 metadata
['movieYear'] = eyetv
['info']['start'].year
341 def from_text(full_path
):
343 full_path
= unicode(full_path
, 'utf-8')
344 path
, name
= os
.path
.split(full_path
)
345 title
, ext
= os
.path
.splitext(name
)
350 parent
= os
.path
.dirname(ptmp
)
355 search_paths
.append(os
.path
.join(ptmp
, 'default.txt'))
357 search_paths
.append(os
.path
.join(path
, title
) + '.properties')
358 search_paths
.reverse()
360 search_paths
+= [full_path
+ '.txt',
361 os
.path
.join(path
, '.meta', 'default.txt'),
362 os
.path
.join(path
, '.meta', name
) + '.txt']
364 for metafile
in search_paths
:
365 if os
.path
.exists(metafile
):
366 sep
= ':='[metafile
.endswith('.properties')]
367 for line
in file(metafile
, 'U'):
368 if line
.startswith(BOM
):
370 if line
.strip().startswith('#') or not sep
in line
:
372 key
, value
= [x
.strip() for x
in line
.split(sep
, 1)]
373 if not key
or not value
:
375 if key
.startswith('v'):
377 metadata
[key
].append(value
)
379 metadata
[key
] = [value
]
381 metadata
[key
] = value
383 for rating
, ratings
in [('tvRating', TV_RATINGS
),
384 ('mpaaRating', MPAA_RATINGS
),
385 ('starRating', STAR_RATINGS
)]:
386 x
= metadata
.get(rating
, '').upper()
388 metadata
[rating
] = ratings
[x
]
398 def basic(full_path
, mtime
=None):
399 base_path
, name
= os
.path
.split(full_path
)
400 title
, ext
= os
.path
.splitext(name
)
402 mtime
= os
.path
.getmtime(unicode(full_path
, 'utf-8'))
404 originalAirDate
= datetime
.utcfromtimestamp(mtime
)
406 originalAirDate
= datetime
.utcnow()
408 metadata
= {'title': title
,
409 'originalAirDate': originalAirDate
.isoformat()}
411 if ext
in ['.mp4', '.m4v', '.mov']:
412 metadata
.update(from_moov(full_path
))
413 elif ext
in ['.dvr-ms', '.asf', '.wmv']:
414 metadata
.update(from_dvrms(full_path
))
415 elif 'plistlib' in sys
.modules
and base_path
.endswith('.eyetv'):
416 metadata
.update(from_eyetv(full_path
))
417 metadata
.update(from_nfo(full_path
))
418 metadata
.update(from_text(full_path
))
422 def from_container(xmldoc
):
425 keys
= {'title': 'Title', 'episodeTitle': 'EpisodeTitle',
426 'description': 'Description', 'programId': 'ProgramId',
427 'seriesId': 'SeriesId', 'episodeNumber': 'EpisodeNumber',
428 'tvRating': 'TvRating', 'displayMajorNumber': 'SourceChannel',
429 'callsign': 'SourceStation', 'showingBits': 'ShowingBits',
430 'mpaaRating': 'MpaaRating'}
432 details
= xmldoc
.getElementsByTagName('Details')[0]
435 data
= tag_data(details
, keys
[key
])
437 if key
== 'description':
438 data
= data
.replace(TRIBUNE_CR
, '')
439 elif key
== 'tvRating':
441 elif key
== 'displayMajorNumber':
443 data
, metadata
['displayMinorNumber'] = data
.split('-')
448 def from_details(xml
):
451 xmldoc
= minidom
.parseString(xml
)
452 showing
= xmldoc
.getElementsByTagName('showing')[0]
453 program
= showing
.getElementsByTagName('program')[0]
455 items
= {'description': 'program/description',
456 'title': 'program/title',
457 'episodeTitle': 'program/episodeTitle',
458 'episodeNumber': 'program/episodeNumber',
459 'programId': 'program/uniqueId',
460 'seriesId': 'program/series/uniqueId',
461 'seriesTitle': 'program/series/seriesTitle',
462 'originalAirDate': 'program/originalAirDate',
463 'isEpisode': 'program/isEpisode',
464 'movieYear': 'program/movieYear',
465 'partCount': 'partCount',
466 'partIndex': 'partIndex',
470 data
= tag_data(showing
, items
[item
])
472 if item
== 'description':
473 data
= data
.replace(TRIBUNE_CR
, '')
474 metadata
[item
] = data
476 vItems
= ['vActor', 'vChoreographer', 'vDirector',
477 'vExecProducer', 'vProgramGenre', 'vGuestStar',
478 'vHost', 'vProducer', 'vWriter']
481 data
= _vtag_data(program
, item
)
483 metadata
[item
] = data
485 sb
= showing
.getElementsByTagName('showingBits')
487 metadata
['showingBits'] = sb
[0].attributes
['value'].value
489 #for tag in ['starRating', 'mpaaRating', 'colorCode']:
490 for tag
in ['starRating', 'mpaaRating']:
491 value
= _tag_value(program
, tag
)
493 metadata
[tag
] = value
495 rating
= _tag_value(showing
, 'tvRating')
497 metadata
['tvRating'] = rating
501 def _nfo_vitems(source
, metadata
):
503 vItems
= {'vGenre': 'genre',
504 'vWriter': 'credits',
505 'vDirector': 'director',
506 'vActor': 'actor/name'}
509 data
= _vtag_data_alternate(source
, vItems
[key
])
511 metadata
.setdefault(key
, [])
513 if not dat
in metadata
[key
]:
514 metadata
[key
].append(dat
)
516 if 'vGenre' in metadata
:
517 metadata
['vSeriesGenre'] = metadata
['vProgramGenre'] = metadata
['vGenre']
521 def _parse_nfo(nfo_path
, nfo_data
=None):
522 # nfo files can contain XML or a URL to seed the XBMC metadata scrapers
523 # It's also possible to have both (a URL after the XML metadata)
524 # pyTivo only parses the XML metadata, but we'll try to stip the URL
525 # from mixed XML/URL files. Returns `None` when XML can't be parsed.
527 nfo_data
= [line
.strip() for line
in file(nfo_path
, 'rU')]
530 xmldoc
= minidom
.parseString(os
.linesep
.join(nfo_data
))
531 except expat
.ExpatError
, err
:
532 if expat
.ErrorString(err
.code
) == expat
.errors
.XML_ERROR_INVALID_TOKEN
:
533 # might be a URL outside the xml
534 while len(nfo_data
) > err
.lineno
:
535 if len(nfo_data
[-1]) == 0:
539 if len(nfo_data
) == err
.lineno
:
540 # last non-blank line contains the error
542 return _parse_nfo(nfo_path
, nfo_data
)
545 def _from_tvshow_nfo(tvshow_nfo_path
):
546 if tvshow_nfo_path
in nfo_cache
:
547 return nfo_cache
[tvshow_nfo_path
]
549 items
= {'description': 'plot',
551 'seriesTitle': 'showtitle',
552 'starRating': 'rating',
555 nfo_cache
[tvshow_nfo_path
] = metadata
= {}
557 xmldoc
= _parse_nfo(tvshow_nfo_path
)
561 tvshow
= xmldoc
.getElementsByTagName('tvshow')
568 data
= tag_data(tvshow
, items
[item
])
570 metadata
[item
] = data
572 metadata
= _nfo_vitems(tvshow
, metadata
)
574 nfo_cache
[tvshow_nfo_path
] = metadata
577 def _from_episode_nfo(nfo_path
, xmldoc
):
580 items
= {'description': 'plot',
581 'episodeTitle': 'title',
582 'seriesTitle': 'showtitle',
583 'originalAirDate': 'aired',
584 'starRating': 'rating',
590 basepath
= os
.path
.dirname(path
)
594 tv_nfo
= os
.path
.join(path
, 'tvshow.nfo')
595 if os
.path
.exists(tv_nfo
):
596 metadata
.update(_from_tvshow_nfo(tv_nfo
))
599 episode
= xmldoc
.getElementsByTagName('episodedetails')
605 metadata
['isEpisode'] = 'true'
607 data
= tag_data(episode
, items
[item
])
609 metadata
[item
] = data
611 season
= tag_data(episode
, 'displayseason')
612 if not season
or season
== "-1":
613 season
= tag_data(episode
, 'season')
617 ep_num
= tag_data(episode
, 'displayepisode')
618 if not ep_num
or ep_num
== "-1":
619 ep_num
= tag_data(episode
, 'episode')
620 if ep_num
and ep_num
!= "-1":
621 metadata
['episodeNumber'] = "%d%02d" % (int(season
), int(ep_num
))
623 if 'originalAirDate' in metadata
:
624 metadata
['originalAirDate'] += 'T00:00:00Z'
626 metadata
= _nfo_vitems(episode
, metadata
)
630 def _from_movie_nfo(xmldoc
):
633 movie
= xmldoc
.getElementsByTagName('movie')
639 items
= {'description': 'plot',
642 'starRating': 'rating',
643 'mpaaRating': 'mpaa'}
645 metadata
['isEpisode'] = 'false'
648 data
= tag_data(movie
, items
[item
])
650 metadata
[item
] = data
652 metadata
['movieYear'] = "%04d" % int(metadata
.get('movieYear', 0))
654 metadata
= _nfo_vitems(movie
, metadata
)
657 def from_nfo(full_path
):
658 if full_path
in nfo_cache
:
659 return nfo_cache
[full_path
]
661 metadata
= nfo_cache
[full_path
] = {}
663 nfo_path
= "%s.nfo" % os
.path
.splitext(full_path
)[0]
664 if not os
.path
.exists(nfo_path
):
667 xmldoc
= _parse_nfo(nfo_path
)
671 if xmldoc
.getElementsByTagName('episodedetails'):
673 metadata
.update(_from_episode_nfo(nfo_path
, xmldoc
))
674 elif xmldoc
.getElementsByTagName('movie'):
676 metadata
.update(_from_movie_nfo(xmldoc
))
679 if 'starRating' in metadata
:
680 # .NFO 0-10 -> TiVo 1-7
681 rating
= int(float(metadata
['starRating']) * 6 / 10 + 1.5)
682 metadata
['starRating'] = rating
684 for key
, mapping
in [('mpaaRating', MPAA_RATINGS
),
685 ('tvRating', TV_RATINGS
)]:
687 rating
= mapping
.get(metadata
[key
], None)
689 metadata
[key
] = rating
693 nfo_cache
[full_path
] = metadata
696 def _tdcat_bin(tdcat_path
, full_path
, tivo_mak
):
697 fname
= unicode(full_path
, 'utf-8')
699 fname
= fname
.encode('cp1252')
700 tcmd
= [tdcat_path
, '-m', tivo_mak
, '-2', fname
]
701 tdcat
= subprocess
.Popen(tcmd
, stdout
=subprocess
.PIPE
)
702 return tdcat
.stdout
.read()
704 def _tdcat_py(full_path
, tivo_mak
):
707 tfile
= open(full_path
, 'rb')
708 header
= tfile
.read(16)
709 offset
, chunks
= struct
.unpack('>LH', header
[10:])
710 rawdata
= tfile
.read(offset
- 16)
714 for i
in xrange(chunks
):
715 chunk_size
, data_size
, id, enc
= struct
.unpack('>LLHH',
716 rawdata
[count
:count
+ 12])
718 data
= rawdata
[count
:count
+ data_size
]
719 xml_data
[id] = {'enc': enc
, 'data': data
, 'start': count
+ 16}
720 count
+= chunk_size
- 12
723 details
= chunk
['data']
725 xml_key
= xml_data
[3]['data']
727 hexmak
= hashlib
.md5('tivo:TiVo DVR:' + tivo_mak
).hexdigest()
728 key
= hashlib
.sha1(hexmak
+ xml_key
).digest()[:16] + '\0\0\0\0'
730 turkey
= hashlib
.sha1(key
[:17]).digest()
731 turiv
= hashlib
.sha1(key
).digest()
733 details
= turing
.Turing(turkey
, turiv
).crypt(details
, chunk
['start'])
737 def from_tivo(full_path
):
738 if full_path
in tivo_cache
:
739 return tivo_cache
[full_path
]
741 tdcat_path
= config
.get_bin('tdcat')
742 tivo_mak
= config
.get_server('tivo_mak')
746 details
= _tdcat_bin(tdcat_path
, full_path
, tivo_mak
)
748 details
= _tdcat_py(full_path
, tivo_mak
)
749 metadata
= from_details(details
)
750 tivo_cache
[full_path
] = metadata
756 def force_utf8(text
):
757 if type(text
) == str:
759 text
= text
.decode('utf8')
761 if sys
.platform
== 'darwin':
762 text
= text
.decode('macroman')
764 text
= text
.decode('cp1252')
765 return text
.encode('utf-8')
767 def dump(output
, metadata
):
769 value
= metadata
[key
]
770 if type(value
) == list:
772 output
.write('%s: %s\n' % (key
, item
.encode('utf-8')))
774 if key
in HUMAN
and value
in HUMAN
[key
]:
775 output
.write('%s: %s\n' % (key
, HUMAN
[key
][value
]))
777 output
.write('%s: %s\n' % (key
, value
.encode('utf-8')))
779 if __name__
== '__main__':
780 if len(sys
.argv
) > 1:
783 logging
.basicConfig()
784 fname
= force_utf8(sys
.argv
[1])
785 ext
= os
.path
.splitext(fname
)[1].lower()
787 metadata
.update(from_tivo(fname
))
788 elif ext
in ['.mp4', '.m4v', '.mov']:
789 metadata
.update(from_moov(fname
))
790 elif ext
in ['.dvr-ms', '.asf', '.wmv']:
791 metadata
.update(from_dvrms(fname
))
793 vInfo
= plugins
.video
.transcode
.video_info(fname
)
794 metadata
.update(from_mscore(vInfo
['rawmeta']))
795 dump(sys
.stdout
, metadata
)