Automated, high-performance pipeline and Web Studio for generating and uploading viral 9:16 vertical YouTube Shorts from top Reddit posts and comments.
- ๐ Reddit Scraping Engine: Dual-path scraper utilizing headless Chromium (Playwright) and public JSON API fallbacks to fetch top stories, comments, upvotes, and metadata with built-in deduplication history.
- ๐จ Dark Mode Card Renderer: HTML/CSS Jinja2 screenshot renderer creating Reddit post & comment cards (with pure-Python Pillow fallback).
- ๐๏ธ Neural TTS Voiceover: Microsoft Edge Neural TTS with natural male and female voices (Christopher, Guy, Ana, Jenny).
- ๐๏ธ GPU Hardware-Accelerated Compositor: Hardware encoding supporting NVIDIA NVENC (
h264_nvenc), AMD AMF (h264_amf), and Intel QSV (h264_qsv) with automatic fallback to CPUlibx264, rendering vertical 1080x1920 60/30fps videos. - ๐ฌ Viral Word-Level Dynamic Subtitles: On-screen animated captions ("Yellow Pill", "Neon Cyan Glow", "Minimalist White") synchronized with voiceover timestamps.
- ๐ต AI Soundtrack Generator: Meta MusicGen (
facebook/musicgen-small) soundtrack synthesis with local DSP Lofi beat fallback. - ๐ง Local LLM Metadata Engine: Automatically generates catchy titles, engaging descriptions, and hashtags using local Ollama models (e.g. Gemma 3).
- ๐ฆ Batch Queue Mode: Generate and queue multiple shorts across custom subreddit pools.
- ๐ YouTube Data API v3 Auto-Upload: Direct OAuth2 resumable upload flow with unlisted, public, or private visibility.
- ๐ฅ๏ธ Web Studio UI: Modern dark-mode FastAPI control room with live preview, video scrubber, background manager, and one-click YouTube API setup.
- Python 3.10+ (Python 3.11 recommended)
- FFmpeg (installed or automatically resolved via
imageio-ffmpeg) - Optional: GPU (NVIDIA with NVENC, AMD with AMF, or Intel with QuickSync) for hardware acceleration
- Optional: Ollama installed locally (
ollama run gemma3:4b) for viral AI titles & descriptions
Clone the repository:
git clone https://github.com/BloopieBlair/RedditReadingApp.git
cd RedditReadingAppCreate and activate a virtual environment:
# Windows
python -m venv .venv
.\.venv\Scripts\activate
# Linux / macOS
python3 -m venv .venv
source .venv/bin/activateInstall dependencies:
pip install -r requirements.txt
playwright install chromium# Windows quick launcher
start.bat
# Or run via Python
python -m src.web.appOpen your browser and navigate to: http://127.0.0.1:8000
To enable automatic uploading of generated Shorts directly to your YouTube channel:
- Click
Enter YouTube API for Auto-Uploadin the top-right header of the Web Studio. - In the setup modal, you can either:
- Enter your OAuth Client ID & Client Secret, OR
- Upload your
client_secret.jsonfile directly from Google Cloud Console.
- Visit the Google Cloud Console.
- Create a new project (e.g.
Reddit-Shorts-Generator). - Under APIs & Services > Library, search for YouTube Data API v3 and click Enable.
- Under APIs & Services > OAuth consent screen, select External, provide an app name, and add your Google email address under Test users.
- Under APIs & Services > Credentials, click Create Credentials > OAuth client ID.
- Select Desktop app as the application type.
- Download the
client_secret.jsonor copy the Client ID and Client Secret into the Web Studio modal. - Click Connect & Authorize YouTube to complete the one-time Google browser login.
You can easily use your own background gameplay videos (e.g. Minecraft parkour, Subway Surfers, GTA V stunt races, satisfying ASMR, etc.):
- Drop your video into
assets/backgrounds/(supports.mp4,.mov,.webm,.mkv), OR - Select or upload it via the Web Studio UI in the Background Video selector.
- Universal Aspect Ratio Support: You can provide footage of any resolution or orientation (16:9 widescreen, 4:3, ultra-wide, or vertical 9:16).
- Automated Center Crop & Scaling: The background engine automatically computes aspect ratios, removes letterboxing, and rescales footage to crisp 1080ร1920 (9:16 vertical) format.
- Randomized Dynamic Start Points: For long gameplay footage (e.g. 10โ20 minute clips), the compositor automatically samples a fresh, random starting timestamp for each generated short so your channel videos remain dynamic and visually unique.
- Seamless Looping: If your background clip is shorter than the narrated story, the engine automatically loops the footage smoothly without frame drops.
- Persistent Library for Re-use: All placed backgrounds remain indexed in your local library for instant selection in both single-video and batch generation runs without needing to re-process.
You can also run every pipeline stage directly via the command line:
# Run full end-to-end pipeline in dry-run test mode
python main.py pipeline --subreddit AskReddit --dry-run
# Run full pipeline and upload to YouTube (unlisted)
python main.py pipeline --subreddit funny --upload --privacy unlisted
# Scrape top post and render HTML cards
python main.py scrape --subreddit AskReddit --limit 5
# Generate TTS voiceover from custom text
python main.py tts --text "This is a test Reddit story narration." --voice en-US-ChristopherNeural --output test.mp3
# Composite short video from existing scraped assets and audio
python main.py composite --post-json output/post.json --audio-dir output/audio/ --output output/short.mp4
# Upload an existing video to YouTube Shorts
python main.py upload --video output/short.mp4 --title "Incredible Reddit Story" --privacy unlistedRun the test suite:
python -m pytestRedditReadingApp/
โโโ assets/
โ โโโ backgrounds/ # 9:16 background video assets
โ โโโ music/ # AI generated & DSP soundtracks
โ โโโ templates/ # Jinja2 card HTML templates
โ โโโ client_secret.json.example
โโโ src/
โ โโโ scraper/ # Reddit scraper & card renderers
โ โโโ tts/ # Neural TTS voice engine
โ โโโ video/ # Video compositor & subtitle overlays
โ โโโ uploader/ # YouTube OAuth & upload manager
โ โโโ web/ # FastAPI web server & UI
โ โโโ ai_generator.py # Ollama/Gemma viral metadata generator
โ โโโ cli.py # Command line interface
โ โโโ config.py # App configurations & paths
โ โโโ history.py # Post deduplication tracker
โ โโโ models.py # Pydantic & dataclass schemas
โ โโโ pipeline.py # Orchestration & batch pipeline
โโโ tests/ # Unit, integration & adversarial test suite
โโโ .env.example # Example environment variables
โโโ .gitignore # Git exclusions
โโโ main.py # CLI entrypoint
โโโ pyproject.toml # Project metadata & pytest configuration
โโโ requirements.txt # Python dependencies
โโโ start.bat # Windows quickstart script
This project is free and open source. If it saved you time or you would like to support continued development, you can optionally support me on Ko-fi.
Donations do not unlock additional features or support. Every public release remains freely available here on GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.


