veda_file_discovery.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:edx-video-pipeline 作者: edx 项目源码 文件源码
def download_video_to_working_directory(self, key, file_name, file_extension):
        """
        Downloads the video to working directory from S3 and
        returns whether its successfully downloaded or not.

        Arguments:
            key: An S3 key whose content is going to be downloaded
            file_name: Name of the file when its in working directory
            file_extension: extension of this file.
        """
        if len(file_extension) == 3:
            file_name = u'{file_name}.{ext}'.format(file_name=file_name, ext=file_extension)
        try:
            key.get_contents_to_filename(os.path.join(self.node_work_directory, file_name))
            file_ingested = True
        except S3DataError:
            file_ingested = False
            LOGGER.exception('[File Ingest] Error downloading the file into node working directory.')

        return file_ingested
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号