SKILL.md
YouTube to HeyGen Long-Form Avatar Video
Converts YouTube videos into long-form landscape avatar videos using your HeyGen AI clone. Two-step Gemini process: full script extraction → condensation to max 2000 words.
What It Does
- Sends YouTube URL to Gemini 2.0 Flash for full content analysis
- Generates a full Alex Hormozi-style script matching the original video's content
- Condenses to max 2000 words (~13-14 minute video at 150 words/min)
- Sends to HeyGen API for landscape video generation (1920x1080)
- Polls for completion (15-30 minutes) and stores in
youtubelongform_heygen table
How to Run
# Generate long-form avatar video (default 2000 words max)
python3 skills/youtube-to-heygen-longform/scripts/youtube_to_heygen_longform.py "https://www.youtube.com/watch?v=VIDEO_ID"
# With custom word limit
python3 skills/youtube-to-heygen-longform/scripts/youtube_to_heygen_longform.py "https://www.youtube.com/watch?v=VIDEO_ID" --max-words 1500
# Start generation without waiting for completion
python3 skills/youtube-to-heygen-longform/scripts/youtube_to_heygen_longform.py "https://www.youtube.com/watch?v=VIDEO_ID" --no-wait
Configuration
Environment Variables
GEMINI_API_KEY=xxx
HEYGEN_API_KEY=xxx
HEYGEN_AVATAR_ID=xxx # Your avatar clone ID
HEYGEN_VOICE_ID=xxx # Your voice clone ID
DATABASE_URL=postgresql://...
Dependencies
pip install google-generativeai requests psycopg2-binary python-dotenv
Short-Form vs Long-Form Comparison
| Feature |
Short-Form |
Long-Form |
| Max Words |
~180 |
2000 |
| Video Length |
~60 seconds |
~13-14 minutes |
| Dimension |
1080x1920 (vertical) |
1920x1080 (landscape) |
| Caption |
Yes |
No |
| Database Table |
geminivideoagent |
youtubelongform_heygen |
| Generation Time |
2-5 minutes |
15-30 minutes |
| Polling Interval |
10 seconds |
30 seconds |
| Timeout |
10 minutes |
30 minutes |
Important Notes
- Generation Time: 15-30 minutes for 10+ minute videos — be patient
- Word Limit: ~150 words = 1 minute speaking time
- Two-Step Gemini: First extracts full content, then condenses to target length
- Newlines: Strip all
\n literals — they cause unnatural pauses
- Timeout: 30-minute timeout with 30-second polling intervals
Scripts
| File |
Purpose |
youtubetoheygen_longform.py |
Main long-form avatar video generator |