Skip to content

About

Automated bot that generates viral vertical videos (9:16) for TikTok, Reels, and Shorts — powered by "Would you rather?" questions.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

🔴 Red or Blue

Automated bot that generates viral vertical videos (9:16) for TikTok, Reels, and Shorts — powered by "Would you rather?" questions.

Originally built in 2024, revised and open-sourced in 2026.


How It Works

For each video the bot:

  1. Selects a unique question from the database (no repeats)
  2. Downloads two relevant images via SerpApi
  3. Generates voiceover with ElevenLabs TTS
  4. Renders a 9:16 video with text, images, and synced audio
  5. Concatenates all videos into a single final file and cleans up

Project Structure

red-or-blue/
├── main.py
├── Audios/
│   └── elevenlabsTTS.py
├── videos/
│   ├── background_video_text.py
│   └── background_video_perc.py
├── image_creation/
│   └── image_api.py
├── questions/
│   ├── questions.py
│   ├── questions.json
│   └── used_questions.txt
└── fonts/
    └── Kanit-Bold.ttf

Setup

git clone https://github.com/yourusername/red-or-blue.git
cd red-or-blue
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env   # add your API keys

Required assets (not included):

  • videos/background.mp4 — background video
  • Audios/question.mp3, or.mp3, correct.mp3, clock.mp3 — static audio files
  • fonts/Kanit-Bold.ttf — only for percentage mode

Usage

python main.py

Set the number of videos to generate in main.py:

num_videos = 10

To reset used questions:

echo '' > ./questions/used_questions.txt

APIs

Service Purpose Free tier
ElevenLabs Text-to-speech 10,000 chars/month
SerpApi Image search 100 searches/month

Video Modes

Text mode (background_video_text.py) — shows both choices as text. One highlights in yellow at the end.

Percentage mode (background_video_perc.py) — shows random vote percentages (e.g. 63% vs 37%). To use it:

# in main.py
from videos import background_video_perc as background_video

Adding Questions

Add entries to questions/questions.json:

["Choice A", "Choice B", "image keyword A", "image keyword B"]

Requirements

  • Python 3.8+
  • ImageMagick — brew install imagemagick
  • FFmpeg — brew install ffmpeg

License

MIT — see LICENSE


Support

If this project saved you time, consider buying me a coffee. ☕

About

Automated bot that generates viral vertical videos (9:16) for TikTok, Reels, and Shorts — powered by "Would you rather?" questions.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages