Automated video transcription and recap workflow for Quilibrium streams. Downloads videos from any platform, transcribes via OpenAI Whisper, generates formatted recaps, and uploads to the Quilibrium YouTube channel.
Designed to run through AI coding agents using workflow prompts. Works with Claude Code, OpenCode, or any AI agent that can execute shell commands and follow markdown instructions.
The workflow has two independent parts:
-
Transcribe + Recap (anyone can do this)
- Download video from Twitch, YouTube, Twitter/X, etc.
- Transcribe audio via OpenAI Whisper API
- Generate a formatted recap using Claude
- Verify accuracy against the transcript
- Output: full recap + short version for Discord/Telegram
-
Upload to YouTube (requires Quilibrium channel access)
- Upload the video to the Quilibrium YouTube channel
- Auto-generate title, description, thumbnail, and tags
- Requires editor/manager access to the channel
Once set up, the entire workflow is two slash commands in chat:
/Q:video-recap https://www.twitch.tv/videos/XXXXXXX
This downloads, transcribes, generates the recap, verifies it, and asks for your approval.
/Q:youtube-upload
This generates a title, asks for approval, uploads the video, sets the thumbnail, and offers to clean up temporary files.
The workflow prompts are plain markdown files in .claude/commands/Q/. You can feed them to any AI agent:
- Open
.claude/commands/Q/video-recap.mdand paste it as instructions to your agent along with the video URL - The agent will follow the step-by-step workflow using the Python scripts
- For YouTube upload, use
.claude/commands/Q/youtube-upload.md
You can also run the scripts directly:
# Step 1: Download and transcribe
python scripts/video_transcribe.py --url "https://www.twitch.tv/videos/XXXXXXX"
# Step 2: Write the recap manually or with any LLM using the transcript in output/transcriptions/
# Step 3: Upload to YouTube (optional)
python scripts/upload_to_youtube.py --title "Your Title Here"- Python 3.10+
- ffmpeg in PATH
- A Groq API key (free, for transcription) or an OpenAI API key
- An AI coding agent (optional but recommended): Claude Code, OpenCode, or similar
git clone https://github.com/QuilibriumNetwork/q-stream-recap.git
cd q-stream-recap
pip install -r requirements.txtInstall ffmpeg if you don't have it:
# Windows
winget install ffmpeg
# Mac
brew install ffmpeg
# Linux
apt install ffmpegcp .env.example .envBy default, the pipeline uses Groq (free, open-source Whisper models). Get a free API key at console.groq.com/keys and add it to .env:
GROQ_API_KEY=gsk_...
Alternatively, you can use OpenAI by setting backend: "openai" in config/config.yaml and adding your OpenAI key to .env.
This step is only needed if you want to upload videos to the Quilibrium YouTube channel. You need to be an editor or manager of the channel.
- Go to Google Cloud Console
- Create a project (or use an existing one)
- Enable YouTube Data API v3 in the Library
- Go to OAuth consent screen and configure it:
- Set to Production (not Testing, otherwise tokens expire after 7 days)
- Add the YouTube scopes
- Create OAuth 2.0 credentials (Application type: Desktop app)
- Download the JSON and save as
config/youtube_secrets.json - Run authentication once via Claude Code or directly:
This opens a browser for Google consent. Sign in with the account that has access to the Quilibrium YouTube channel. The token is saved locally and all future uploads are fully automatic.
python scripts/upload_to_youtube.py --auth-only
Contributions are welcome! You can help by:
- Improving recaps: Submit PRs with corrections to existing recaps in
output/recaps/ - Adding features: Improve the transcription or upload scripts
- Translating recaps: Add translations of existing recaps
You don't need YouTube channel access to contribute. The transcription and recap generation only requires an OpenAI API key.
Edit config/config.yaml to customize:
- OpenAI model selection (
gpt-4o-transcribeorwhisper-1) - Audio processing settings (bitrate, sample rate, chunk size)
- YouTube defaults (category, privacy, tags, thumbnail)
- Output paths
q-stream-recap/
├── scripts/
│ ├── video_transcribe.py # Download + transcribe pipeline
│ ├── audio_processor.py # FFmpeg audio extraction/chunking
│ ├── upload_to_youtube.py # YouTube upload with OAuth
│ └── youtube_client.py # YouTube API client
├── config/
│ ├── config.yaml # Main configuration
│ ├── youtube_secrets.json # YouTube OAuth secrets (not in git)
│ └── .youtube_token.json # Cached OAuth token (not in git)
├── output/
│ ├── downloads/ # Downloaded MP4 files (not in git)
│ ├── audio/ # Extracted audio + chunks (not in git)
│ ├── transcriptions/ # Transcripts + metadata
│ └── recaps/ # Full + short recaps
├── .claude/commands/Q/ # Workflow prompts (work with any AI agent)
├── .env # API keys (not in git)
└── requirements.txt
Uses yt-dlp which supports 1000+ sites including:
- Twitch (VODs and clips)
- YouTube
- Twitter/X
- Vimeo
- TikTok
- Facebook, Instagram, Reddit, and more
Recaps follow a specific format for the Quilibrium community:
- Greeting: "Hey Q fam!" with speaker attribution
- Bullet points use "⦿"
- Section titles use "✅"
- Main title uses "✨"
- Tone: informative, third person, non-technical focus
- Project name is always "Quilibrium" (transcription misspellings are auto-corrected)
A short version is also generated for Discord/Telegram sharing.