(self, s3_file)
Download a file from the S3 output bucket to your hard drive.
Download a file from the S3 output bucket to your hard drive.
Download a file from the S3 output bucket to your hard drive .
def download_from_s3(self, s3_file):
        """
        Download a file from the S3 output bucket to your hard drive.
        """
        destination_path = os.path.join(
            self.converted_directory,
            os.path.basename(s3_file)
        )
        body = self.out_bucket.Object(s3_file).get()['Body']
        with open(destination_path, 'wb') as dest:
            # Here we write the file in chunks to prevent
            # loading everything into memory at once.
            for chunk in iter(lambda: body.read(4096), b''):
                dest.write(chunk)

        print("Downloaded {0}".format(destination_path))
def download_from_s3 ( self , s3_file ) : destination_path = os . path . join ( self . converted_directory , os . path . basename ( s3_file ) ) body = self . out_bucket . Object ( s3_file ) . get ( ) [ 'Body' ] with open ( destination_path , 'wb' ) as dest : # Here we write the file in chunks to prevent # loading everything into memory at once. for chunk in iter ( lambda : body . read ( 4096 ) , b'' ) : dest . write ( chunk ) print ( "Downloaded {0}" . format ( destination_path ) )