Skip to the content.

Automated YouTube Pipeline

WealthCode - Personal finance content for Indian software engineers

9

Pipeline Stages

~4,800

Lines of Python

~$0.10

Cost Per Video

~10 min

Human Review Time

1

What It Does

A self-feeding AI video factory for a personal finance YouTube channel. The topic engine runs weekly to research trending queries, score them against YouTube demand/competition data, and auto-queue the best ones. Then for each topic: Claude generates a script with integrated visual specifications, local TTS creates voiceover, Manim/Pillow render animated visuals, FFmpeg assembles everything, and a human spends ~10 minutes verifying claims via Telegram before YouTube upload. All for about $0.10 per video.

2

Pipeline Architecture

9-stage state machine with resumable checkpoints:

  1. Topic Engine - Research trends, score demand vs competition, auto-queue
  2. Script Generation - Claude AI writes scene-by-scene script with visual specs + data calculations
  3. Voiceover - Kokoro ONNX (local, free) or Edge TTS per scene
  4. Visual Generation - Manim animations (charts, tables) + Pillow text cards
  5. B-Roll - Pexels API fills gaps between AI-generated visuals
  6. Background Music - Selection + volume ducking under voiceover
  7. Assembly - FFmpeg concatenation with audio-video sync
  8. Review - Telegram bot sends preview + claims for human verification
  9. Upload - YouTube API with metadata, thumbnail, scheduling
3

Key Technical Highlights

Self-Feeding Topic Engine

Multi-dimensional scoring: YouTube search demand, competition analysis, evergreen potential. Channel context injection avoids duplicate topics.

Resumable Checkpoint Architecture

13 fine-grained states in SQLite. Can resume from any failed stage without re-running earlier work. Deterministic slug generation enables caching.

Animated Visual Rendering

Manim for animated charts/tables, Pillow for text cards. Dynamic placeholder substitution with Indian lakh-scale auto-detection. Audio-synced duration.

Cost Optimization

Local TTS (Kokoro ONNX, ~80MB model, no GPU). Only Claude API has actual cost. Selective B-roll fetching. ~$0.08-0.15 per video.

4

Tech Stack

Python 3.11+

Core implementation

Claude AI API

Script generation

Kokoro ONNX / Edge TTS

Local text-to-speech

Manim + Pillow

Visual rendering

FFmpeg

Video assembly

SQLite

Pipeline state

Telegram Bot API

Async review

YouTube Data API

Upload + metadata

---
Back to Home YouTube Pipeline (HistoryPulse) Stock Trading Agent