YouTube Creator Agent
Auto-generate and upload YouTube videos from a topic.
What it does
- Takes a topic/idea from the user
- Generates a video script (title, description, narration segments)
- Creates TTS voiceover with edge-tts
- Composes video with ffmpeg (background + subtitles + narration)
- Uploads to YouTube via Data API v3
How to launch
Run the agent in the terminal:
cd ~/youtube-creator && PATH="$PATH:$HOME/Library/Python/3.9/bin" python3 youtube-creator.py
Then interact:
youtube >> 做一个3分钟的视频,主题是"如何用AI提升工作效率"
Quick mode (non-interactive)
To generate a video without entering interactive mode, use bash:
cd ~/youtube-creator && PATH="$PATH:$HOME/Library/Python/3.9/bin" python3 -c "
from dotenv import load_dotenv; load_dotenv(override=True)
import os; os.environ['PATH'] += ':/Users/adam/Library/Python/3.9/bin'
exec(open('youtube-creator.py').read().split('if __name__')[0])
history = [{'role': 'user', 'content': 'YOUR_TOPIC_HERE'}]
agent_loop(history)
"
Available tools in the agent
bash— shell commandsread_file/write_file— file operationsgenerate_assets— TTS voiceover + SRT subtitles + background imagecompose_video— ffmpeg video compositionupload_youtube— YouTube Data API v3 upload (OAuth required)
Configuration
- LLM API:
~/youtube-creator/.env(Kimi/Anthropic compatible) - YouTube OAuth:
~/youtube-creator/.env(Client ID + Secret) - Output directory:
~/youtube-creator/output/
First-time YouTube upload
First upload will open a browser window for Google OAuth authorization.
After that, the token is cached in youtube_token.json.