#NEWLINE# @ staticmethod #NEWLINE# def parse( filename ) : #NEWLINE# #INDENT# if ( os . name in ( 'nt' , 'dos' , 'os2' , 'ce' ) ) : #NEWLINE# #INDENT# lib = windll . MediaInfo #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( sys . platform == 'darwin' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# lib = CDLL ( 'libmediainfo.0.dylib' ) #NEWLINE# #UNINDENT# except OSError : #NEWLINE# #INDENT# lib = CDLL ( 'libmediainfo.dylib' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# lib = CDLL ( 'libmediainfo.so.0' ) #NEWLINE# #UNINDENT# #UNINDENT# lib . MediaInfo_Inform . restype = c_wchar_p #NEWLINE# lib . MediaInfo_New . argtypes = [ ] #NEWLINE# lib . MediaInfo_New . restype = c_void_p #NEWLINE# lib . MediaInfo_Option . argtypes = [ c_void_p , c_wchar_p , c_wchar_p ] #NEWLINE# lib . MediaInfo_Option . restype = c_wchar_p #NEWLINE# lib . MediaInfoA_Option . argtypes = [ c_void_p , c_char_p , c_char_p ] #NEWLINE# lib . MediaInfoA_Option . restype = c_char_p #NEWLINE# lib . MediaInfo_Inform . argtypes = [ c_void_p , c_size_t ] #NEWLINE# lib . MediaInfo_Inform . restype = c_wchar_p #NEWLINE# lib . MediaInfoA_Open . argtypes = [ c_void_p , c_char_p ] #NEWLINE# lib . MediaInfoA_Open . restype = c_size_t #NEWLINE# lib . MediaInfo_Delete . argtypes = [ c_void_p ] #NEWLINE# lib . MediaInfo_Delete . restype = None #NEWLINE# lib . MediaInfo_Close . argtypes = [ c_void_p ] #NEWLINE# lib . MediaInfo_Close . restype = None #NEWLINE# handle = lib . MediaInfo_New ( ) #NEWLINE# lib . MediaInfo_Option ( handle , 'CharSet' , 'UTF-8' ) #NEWLINE# lib . MediaInfoA_Option ( None , b'Inform' , b'XML' ) #NEWLINE# lib . MediaInfoA_Option ( None , b'Complete' , b'1' ) #NEWLINE# lib . MediaInfoA_Open ( handle , filename . encode ( 'utf8' ) ) #NEWLINE# xml = lib . MediaInfo_Inform ( handle , 0 ) #NEWLINE# lib . MediaInfo_Close ( handle ) #NEWLINE# lib . MediaInfo_Delete ( handle ) #NEWLINE# return MediaInfo ( xml )