Add script to create videos for speaking questions.

This commit is contained in:
Cristiano Ferreira
2023-09-03 18:05:13 +01:00
parent 685fde0b77
commit 64776617f2
13 changed files with 27611 additions and 7 deletions

View File

@@ -22,5 +22,24 @@ def upload_file_firebase(bucket_name, destination_blob_name, source_file_name):
print("Error uploading file to Google Cloud Storage:", e)
return False
def upload_file_firebase_get_url(bucket_name, destination_blob_name, source_file_name):
# Uploads a file to Firebase Storage.
storage_client = storage.Client()
bucket = storage_client.bucket(bucket_name)
try:
blob = bucket.blob(destination_blob_name)
blob.upload_from_filename(source_file_name)
print(f"File uploaded to {destination_blob_name}")
# Make the file public
blob.make_public()
# Get the public URL
url = blob.public_url
return url
except Exception as e:
print("Error uploading file to Google Cloud Storage:", e)
return None