Author: dmeyer Date: Mon Apr 17 18:55:15 2006 New Revision: 1408 Modified: trunk/metadata/src/video/asfinfo.py
Log: detect DRM files Modified: trunk/metadata/src/video/asfinfo.py ============================================================================== --- trunk/metadata/src/video/asfinfo.py (original) +++ trunk/metadata/src/video/asfinfo.py Mon Apr 17 18:55:15 2006 @@ -4,6 +4,10 @@ # ----------------------------------------------------------------------------- # $Id$ # +# See http://www.thozie.de/dnn/AVIMaster.aspx?PageContentID=4 +# and http://download.microsoft.com/download/e/0/6/e06db390-1e2a-4978-\ +# 82bb-311810d8a28d/ASF_Specification.doc +# # ----------------------------------------------------------------------------- # kaa-Metadata - Media Metadata for Python # Copyright (C) 2003-2005 Thomas Schueppel, Dirk Meyer @@ -262,6 +266,9 @@ flags = struct.unpack('>QIIH4x', s[56:78]) strno = flags & 63 encrypted = flags >> 15 + if encrypted and not 'encrypted' in self.keys: + self.encrypted = True + self.keys.append('encrypted') if streamtype == GUIDS['ASF_Video_Media']: vi = mediainfo.VideoInfo() vi.width, vi.height, depth, \ @@ -340,6 +347,7 @@ idlen = struct.unpack('<B', s[pos:pos+1])[0] idstring = s[pos+1:pos+1+idlen] log.debug("Language: %d/%d: %s" % (i+1, count, idstring)) + idstring = unicode(idstring, 'utf-16').replace('\0', '') lang.append(idstring) pos += 1+idlen if len(lang) == 1: @@ -359,6 +367,11 @@ # TODO: Find the stream in self.audio and self.video and # set it there instead of here + elif guid == GUIDS['ASF_Content_Encryption_Object'] or \ + guid == GUIDS['ASF_Extended_Content_Encryption_Object']: + self.encrypted = True + if not 'encrypted' in self.keys: + self.keys.append('encrypted') else: # Just print the type: for h in GUIDS.keys(): ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Freevo-cvslog mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-cvslog
