diff --git a/yt_dlp_stream_to_s3/main.py b/yt_dlp_stream_to_s3/main.py index e93465f..3ad5b9a 100644 --- a/yt_dlp_stream_to_s3/main.py +++ b/yt_dlp_stream_to_s3/main.py @@ -12,7 +12,7 @@ from yt_dlp_stream_to_s3.errors import YtDlpStreamToS3Error def yt_dlp_stream_to_s3( url: str, expiration=86400 * 7, # 7 days - s3_extra_args: dict = (), + s3_extra_args=dict(), ) -> Dict[str, str]: media_url = remove_queries_from_url(url) @@ -53,12 +53,14 @@ def yt_dlp_stream_to_s3( yt_dlp_process.wait() - return dict( + response = dict( presigned_url=create_presigned_url( AWS_S3_BUCKET_NAME, filename, expiration ), filesize=get_file_size(AWS_S3_BUCKET_NAME, filename), ) + + return response except HTTPError: raise YtDlpStreamToS3Error("Could not connect to the media resource.")