Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ This repository features a sample application for uploading short and long video
* **Run the Application**: Launch the sample app to begin uploading videos to Cloudinary.

That's it! You're ready to start uploading videos with ease.


13 changes: 12 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
# Set your Cloudinary credentials
# import the CLOUDINARY_URL from .env
# ==============================

from dotenv import load_dotenv
load_dotenv()


# Import the Cloudinary libraries
# ==============================

import cloudinary
import cloudinary.uploader


# Upload short video
# ==============================

file_name = "videos/short_video.mp4"

response = cloudinary.uploader.upload_large(file_name,
resource_type = "video")

print(response["secure_url"])


# Upload large video
# ==============================

file_name = "videos/long_video.mp4"

response = cloudinary.uploader.upload_large(file_name,
resource_type = "video",
chunk_size = 6000000)

print(response["secure_url"])
print(response["secure_url"])