Discussions

Ask a Question
Back to All

How to access S3 result_url video file?

Hello,

I generated a Clip using the API, and it returned a result_url which is an S3 link:

s3://d-id-clips-persistent-prod/{user_id}/{clip_id}/{filename}.mp4

I have no knowledge about AWS and I can't find this anywhere online, but how am I able to get this file? I've tried the Node AWS SDK and Python boto3 library, but I either get a 'Forbidden' error or 'AccessDenied'. How am I supposed to authenticate myself for a file that is hosted on their storage?

Here is the Python code I tried: (I censored some strings obviously)

import os
import boto3

client = boto3.client(
    's3',
    aws_access_key_id="my_access_key",
    aws_secret_access_key="my_secret_access_key",
)

bucket = "d-id-clips-persistent-prod"
file = "{user_id}/{clip_id}/{filename}.mp4"

cur_path = os.getcwd()
filename = os.path.join(cur_path, 'download', 'video.mp4')

client.download_file(
    Bucket=bucket,
    Key=file,
    Filename=filename
)

Any help would be greatly appreciated!