video-upload-patterns
Video upload patterns for YouTube, TikTok, and Vimeo. Use when uploading videos to platforms, managing video metadata, scheduling video releases, or handling bulk video uploads.
What this skill does
# Video Upload Patterns
Best practices for uploading videos to major platforms.
## YouTube Upload
### Basic Upload
```python
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload
from google.oauth2.credentials import Credentials
def upload_video_youtube(
credentials: Credentials,
file_path: str,
title: str,
description: str,
tags: list[str],
category_id: str = "22", # People & Blogs
privacy: str = "private"
) -> dict:
"""Upload video to YouTube."""
youtube = build('youtube', 'v3', credentials=credentials)
body = {
"snippet": {
"title": title,
"description": description,
"tags": tags,
"categoryId": category_id
},
"status": {
"privacyStatus": privacy,
"selfDeclaredMadeForKids": False
}
}
media = MediaFileUpload(
file_path,
mimetype='video/*',
resumable=True,
chunksize=1024*1024 # 1MB chunks
)
request = youtube.videos().insert(
part="snippet,status",
body=body,
media_body=media
)
response = None
while response is None:
status, response = request.next_chunk()
if status:
print(f"Uploading: {int(status.progress() * 100)}%")
return response
def set_thumbnail(
credentials: Credentials,
video_id: str,
thumbnail_path: str
):
"""Set custom thumbnail for video."""
youtube = build('youtube', 'v3', credentials=credentials)
media = MediaFileUpload(thumbnail_path, mimetype='image/jpeg')
return youtube.thumbnails().set(
videoId=video_id,
media_body=media
).execute()
def schedule_video(
credentials: Credentials,
video_id: str,
publish_at: str # ISO 8601 format
):
"""Schedule video for future publication."""
youtube = build('youtube', 'v3', credentials=credentials)
return youtube.videos().update(
part="status",
body={
"id": video_id,
"status": {
"privacyStatus": "private",
"publishAt": publish_at
}
}
).execute()
```
### Resumable Upload with Progress
```python
import os
import time
from googleapiclient.errors import HttpError
class YouTubeUploader:
MAX_RETRIES = 10
RETRIABLE_STATUS_CODES = [500, 502, 503, 504]
def __init__(self, credentials):
self.youtube = build('youtube', 'v3', credentials=credentials)
def upload_with_retry(
self,
file_path: str,
metadata: dict,
progress_callback=None
) -> dict:
"""Upload with automatic retry on failure."""
file_size = os.path.getsize(file_path)
media = MediaFileUpload(
file_path,
mimetype='video/*',
resumable=True,
chunksize=5 * 1024 * 1024 # 5MB chunks
)
request = self.youtube.videos().insert(
part="snippet,status",
body=metadata,
media_body=media
)
response = None
retry = 0
while response is None:
try:
status, response = request.next_chunk()
if status:
progress = status.progress()
bytes_uploaded = int(file_size * progress)
if progress_callback:
progress_callback(progress, bytes_uploaded, file_size)
except HttpError as e:
if e.resp.status in self.RETRIABLE_STATUS_CODES:
retry += 1
if retry > self.MAX_RETRIES:
raise
sleep_seconds = 2 ** retry
print(f"Retry {retry}, sleeping {sleep_seconds}s")
time.sleep(sleep_seconds)
else:
raise
return response
```
## TikTok Upload
### Content Posting API
```python
import requests
from dataclasses import dataclass
from typing import Optional
@dataclass
class TikTokVideo:
video_url: str # URL to video file
title: str
privacy_level: str = "SELF_ONLY" # SELF_ONLY, MUTUAL_FOLLOW_FRIENDS, FOLLOWER_OF_CREATOR, PUBLIC_TO_EVERYONE
disable_duet: bool = False
disable_comment: bool = False
disable_stitch: bool = False
class TikTokUploader:
def __init__(self, access_token: str):
self.access_token = access_token
self.base_url = "https://open.tiktokapis.com/v2"
self.headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
def init_video_upload(self, video: TikTokVideo) -> dict:
"""Initialize video upload and get upload URL."""
response = requests.post(
f"{self.base_url}/post/publish/video/init/",
headers=self.headers,
json={
"post_info": {
"title": video.title,
"privacy_level": video.privacy_level,
"disable_duet": video.disable_duet,
"disable_comment": video.disable_comment,
"disable_stitch": video.disable_stitch
},
"source_info": {
"source": "PULL_FROM_URL",
"video_url": video.video_url
}
}
)
return response.json()
def check_publish_status(self, publish_id: str) -> dict:
"""Check status of video publishing."""
response = requests.post(
f"{self.base_url}/post/publish/status/fetch/",
headers=self.headers,
json={"publish_id": publish_id}
)
return response.json()
def upload_from_file(self, file_path: str, video: TikTokVideo) -> dict:
"""Upload video from local file (requires file hosting)."""
# TikTok requires video URL, so you need to host the file first
# This is a placeholder for the workflow
raise NotImplementedError(
"TikTok requires video URL. Host file and use init_video_upload()"
)
```
### Direct Upload (Chunk-based)
```python
class TikTokDirectUploader:
"""Direct upload using chunk-based approach."""
def __init__(self, access_token: str):
self.access_token = access_token
self.base_url = "https://open.tiktokapis.com/v2"
def init_upload(
self,
file_size: int,
chunk_size: int = 10 * 1024 * 1024 # 10MB
) -> dict:
"""Initialize direct upload."""
total_chunks = (file_size + chunk_size - 1) // chunk_size
response = requests.post(
f"{self.base_url}/post/publish/inbox/video/init/",
headers={
"Authorization": f"Bearer {self.access_token}",
"Content-Type": "application/json"
},
json={
"source_info": {
"source": "FILE_UPLOAD",
"video_size": file_size,
"chunk_size": chunk_size,
"total_chunk_count": total_chunks
}
}
)
return response.json()
def upload_chunk(
self,
upload_url: str,
chunk_data: bytes,
chunk_index: int,
total_chunks: int
):
"""Upload a single chunk."""
response = requests.put(
upload_url,
headers={
"Content-Type": "video/mp4",
"Content-Range": f"bytes {chunk_index * len(chunk_data)}-{(chunk_index + 1) * len(chunk_data) - 1}/{total_chunks * len(chunk_data)}"
},
data=chunk_data
)
return response
def upload_file(self, file_path: str) -> dict:
"""Upload complete file in chunks."""
import os
file_size = os.path.getsize(file_path)
chunk_size = 10 * 1024 * 1024Related in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".