klingai-storage-integration

Featured

Download and store Kling AI generated videos in cloud storage (S3, GCS, Azure). Use when persisting videos or building CDN pipelines. Trigger with phrases like 'klingai storage', 'save klingai video', 'kling ai s3 upload', 'klingai cloud storage'.

AI & Automation 2,359 stars 334 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Kling AI Storage Integration ## Overview Kling AI video URLs from `task_result.videos[].url` are temporary CDN links that expire. You must download and store videos in your own storage. This skill covers S3, GCS, and Azure Blob. ## Download from Kling CDN ```python import requests import os def download_video(video_url: str, output_dir: str = "output") -> str: """Download generated video from Kling CDN.""" os.makedirs(output_dir, exist_ok=True) # Extract filename or generate one filename = video_url.split("/")[-1].split("?")[0] if not filename.endswith(".mp4"): filename = f"kling_{int(time.time())}.mp4" filepath = os.path.join(output_dir, filename) response = requests.get(video_url, stream=True, timeout=120) response.raise_for_status() with open(filepath, "wb") as f: for chunk in response.iter_content(chunk_size=8192): f.write(chunk) size_mb = os.path.getsize(filepath) / (1024 * 1024) print(f"Downloaded: {filepath} ({size_mb:.1f} MB)") return filepath ``` ## Upload to AWS S3 ```python import boto3 def upload_to_s3(filepath: str, bucket: str, key_prefix: str = "kling-videos/") -> str: """Upload video to S3 and return public URL.""" s3 = boto3.client("s3") filename = os.path.basename(filepath) s3_key = f"{key_prefix}{filename}" s3.upload_file( filepath, bucket, s3_key, ExtraArgs={"ContentType": "video/mp4", "CacheControl": "max-age=86400"} ) ur...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
8 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category