def parse_file(filename): filename = make_unicode(filename) try: parser = createParser(filename) except InputStreamError, err: logger.error("stream error! %s\n" % unicode(err)) return None
def extract(filename): """Extract the metadata from the media file""" filename = unicode(filename) try: parser = createParser(filename) except InputStreamError, err: logger.error("stream error! %s\n" % unicode(err)) return None
def metadata(objeto, key): uid = objeto.UID() registry = getUtility(IRegistry) global_settings = registry.forInterface(IStreamingSettings) path = global_settings.path file = path + uid + "_video.flv" parser = createParser(unicode(file)) if parser is not None: metadata = extractMetadata(parser) if metadata is not None: if metadata.has(key): return metadata.get(key) return None
def extract(filename): """Extract the metadata from the media file""" from hachoir_parser.guess import createParser from hachoir_metadata.metadata import extractMetadata from hachoir_core.error import HachoirError from hachoir_core.stream import InputStreamError filename = unicode(filename) try: parser = createParser(filename) except InputStreamError, err: logger.warning("Stream error! %s" % unicode(err)) return None
def load_file(app, filename): parser = createParser(force_unicode(filename), real_filename = filename) if not parser: return new_window(app, open(filename, 'rb'), parser, filename)
def load_file(app, filename): parser = createParser(force_unicode(filename), real_filename=filename) if not parser: return new_window(app, open(filename, 'rb'), parser, filename)