Skip to content

Latest commit

Β 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 Shortube β€” AI-Powered YouTube Shorts Generator & Automation Studio

Turn ideas into published YouTube Shorts automatically: trend discovery β†’ AI script β†’ voiceover β†’ video β†’ upload

Shortube is a free, open-source YouTube Shorts automation tool that takes a topic β€” or discovers trending topics for you β€” and produces a finished, published YouTube Short: an AI-written script, a natural text-to-speech voiceover, a Remotion-rendered video with karaoke captions, branded thumbnail, and an automatic upload to your YouTube channel.


Python GUI Rendering TTS YouTube License CI Issues

⭐ From idea to published Short in minutes β€” no video editing skills required.


πŸ“š Table of Contents


✨ Features

πŸ–₯️ Desktop App (PyQt6)

Feature What it does
🏠 Dashboard Generate by topic or one-click Auto mode with live progress bar, stage-by-stage log, and job cancellation
πŸ”₯ Trends Refresh trending topics in your niche (LLM-refined), click to generate
🎞️ Videos Thumbnail gallery, open local files or YouTube links, retry failed videos with cache resume
βš™οΈ Settings Tabbed config β€” LLM, voice, video & quality, upload, advanced β€” with Test Connection and YouTube channel picker
πŸ•’ Schedule Automatic generation on an interval with a daily limit (survives restarts)
πŸ“Š Analytics Views, likes and comments for your uploaded videos
πŸ§™ Setup Wizard First-run guide: LLM provider β†’ template β†’ quality β†’ YouTube connection
πŸ›‘οΈ Dependency Check Friendly startup warnings for missing Node.js / Remotion / ffmpeg

✍️ AI Script Generation

  • 🧠 LLM-powered scripts β€” hook, body points, CTA, keywords, title and tags in a single validated prompt
  • βœ… Strict quality gate β€” hook/points/CTA length, keyword density β‰₯ 60%, spoken duration ≀ 55s, duplicate & junk detection with up to 3 automatic retries
  • πŸ”„ Self-healing β€” malformed LLM output is detected and retried with the exact fix hints

🌐 Trend Discovery (Find Shorts Topics That Get Views)

  • πŸ“° 3 sources β€” Hacker News (Algolia), RSS (NYT, BBC, The Verge, Wired, Ars Technica), YouTube Search (Data API)
  • 🎯 LLM refinement β€” headlines converted into Shorts-optimized topics for your niche
  • 🚫 Used-topic tracking β€” never re-generates a topic you've already uploaded

🎬 Video Assembly (Remotion)

  • πŸ’¬ Word-synced karaoke captions β€” timed to TTS word boundaries
  • 🎨 Config-driven templates β€” colors, transitions (zoomBlur / fade / slide / wipe), Ken Burns, caption style
  • πŸŽ‰ Intro/outro bumpers β€” progress ring, typewriter title, subscribe CTA
  • πŸ”Š Sound design β€” whoosh/pop/riser SFX + background music with ducking
  • 🎚️ Loudness normalized to YouTube's -14 LUFS
  • ⏱️ 60s Shorts cap enforced at both script and voiceover level

πŸ“€ YouTube Upload & SEO

  • πŸ” OAuth 2.0 with token persistence (browser flow)
  • 🏷️ Tags & keywords β€” the LLM generates 3–8 keywords and 4–12 tags per script; the description auto-appends the first 8 tags as #hashtags, truncated at YouTube's 500-char limit
  • πŸͺ‚ Fallback tags β€” TAGS_DEFAULT (shorts, youtubeshorts) when a script has none
  • πŸ–ΌοΈ Branded thumbnails, πŸ“… scheduled publishing, ▢️ playlist assignment, πŸ‘₯ multi-channel selection

πŸ€” Why Shortube?

Problem Shortube's answer
"I have no time to edit Shorts" The whole production chain runs unattended β€” including auto-discovery and scheduled publishing
"I don't know what topics to make" Built-in trend discovery from 3 sources, LLM-refined for your niche
"AI voiceovers sound robotic" edge-tts neural voices with word-level timestamps for perfect caption sync
"I can't edit video" Remotion renders everything from a JSON template β€” colors, transitions, captions, bumpers, SFX
"Manual upload is a chore" OAuth 2.0 auto-upload with title, description, tags, thumbnail, and optional playlist
"Other tools cost $30+/month" 100% free and open source (MIT) β€” pay only for LLM API usage if you want

βš™οΈ How It Works β€” the Automated Pipeline

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Topic  β”‚ β†’ β”‚ Script β”‚ β†’ β”‚Voiceover β”‚ β†’ β”‚Storyboardβ”‚ β†’ β”‚Assembly β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚  (LLM) β”‚   β”‚ (edge-  β”‚   β”‚ (media + β”‚   β”‚(Remotionβ”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚   tts)  β”‚   β”‚  AI img) β”‚   β”‚  + SFX) β”‚
                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
                                                             β–Ό
                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚ YouTube  β”‚ ← β”‚Thumbnail β”‚ ← β”‚  loudnorm -14β”‚
                       β”‚  Upload  β”‚   β”‚ (Pillow) β”‚   β”‚     LUFS     β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Each stage is resumable: a cached script + storyboard + voiceover chain is reused all-or-nothing, so a failed render restarts from the last good piece β€” never from zero.


πŸš€ Quick Start

πŸ“‹ Prerequisites

Requirement Why
🐍 Python 3.11+ Core engine
⚑ Node.js 18+ Remotion rendering
🎬 ffmpeg (on PATH) Loudness normalization (recommended)
πŸ¦™ Ollama or API key LLM for script writing

πŸ“¦ Installation

# Python dependencies
pip install -r requirements.txt

# Remotion renderer
cd remotion
npm install
cd ..

▢️ Run

python -m shortube.desktop

On first launch, the setup wizard walks you through everything β€” pick your LLM provider, connect your YouTube channel, choose a template and quality preset. All of it is editable later in Settings.

πŸ§ͺ CLI (power users)

python -m shortube.main                # Show trending topics
python -m shortube.main generate -t "Mind-blowing facts about the universe"
python -m shortube.main auto           # Auto-discover, generate, upload

🧠 LLM Providers

Shortube works with any OpenAI-compatible LLM provider β€” switch anytime in Settings β†’ LLM:

Provider Setup Cost
⚑ Groq (default) GROQ_API_KEY Fast & cheap
🌐 OpenRouter OPENROUTER_API_KEY Many models (incl. free ones)
πŸ¦™ Ollama local install, no key Free, runs on your machine
GROQ_API_KEY=gsk_xxx
# or
OPENROUTER_API_KEY=sk-or-xxx
# or (no key needed)
LLM_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434

🎚️ Quality Presets

Control render speed vs. output quality β€” pick in Settings β†’ Video & Quality:

Preset 🎞️ fps βš™οΈ Concurrency 🎨 CRF πŸ”Š Audio bitrate Best for
⚑ fast 24 2 22 160k Drafts, quick previews
βš–οΈ standard 30 auto 18 192k Everyday uploads
πŸ’Ž pro 30 cores/2 14 256k Maximum quality

πŸ“Œ Tip: CRF is the H.264 quality knob β€” lower = better quality, bigger file. YouTube re-encodes anyway, so standard is the sweet spot for Shorts.


πŸ–ΌοΈ Visual Templates

Every render's look is defined by a JSON template in templates/ β€” colors, fonts, transitions, Ken Burns, caption style and outro styling. Templates are hot-swappable without touching code.

Template Vibe
🟒 premium (default) Premium Bold β€” dark, zoomBlur transitions, green accent
πŸ”΅ clean Clean Minimal β€” light, slide transitions, blue accent

Create your own by copying one and picking new colors β€” the app lists it automatically.


πŸ—οΈ Architecture

shortube/
β”œβ”€β”€ πŸ–₯️ desktop/                # PyQt6 desktop app
β”‚   β”œβ”€β”€ app.py                 # Entry point (python -m shortube.desktop)
β”‚   β”œβ”€β”€ main_window.py         # Thin view: navigation + job wiring
β”‚   β”œβ”€β”€ app_controller.py      # Facade for all DB write orchestration
β”‚   β”œβ”€β”€ workers.py             # Background job thread, signals, cancel
β”‚   β”œβ”€β”€ setup_wizard.py        # First-run configuration wizard
β”‚   β”œβ”€β”€ theme.py               # Dark theme, template-aware accent color
β”‚   └── pages/                 # dashboard Β· trends Β· videos Β· settings Β· schedule Β· analytics
β”œβ”€β”€ main.py                    # CLI entry point (Click)
β”œβ”€β”€ pipeline.py                # PipelineOrchestrator: typed stages + resume
β”œβ”€β”€ script.py                  # ScriptWriter: LLM script generation + validation + retries
β”œβ”€β”€ voice.py                   # edge-tts voiceover with word timestamps
β”œβ”€β”€ storyboard.py              # Scene builder + media providers
β”œβ”€β”€ assemble.py                # Remotion assembly + loudness normalization
β”œβ”€β”€ remotion_bridge.py         # Python ⇄ Remotion CLI integration
β”œβ”€β”€ quality.py                 # Fast/Standard/Pro render presets
β”œβ”€β”€ template_loader.py         # Visual templates (templates/*.json)
β”œβ”€β”€ scheduler.py               # Auto-generation (APScheduler, persisted daily limit)
β”œβ”€β”€ upload.py                  # YouTube Data API v3 upload + thumbnails
β”œβ”€β”€ analytics.py               # Video statistics
β”œβ”€β”€ discover.py                # Trend discovery engine
β”œβ”€β”€ llm.py                     # One OpenAI-compatible LLM client (Groq / OpenRouter / Ollama)
β”œβ”€β”€ settings_env.py            # .env persistence for the settings UI
β”œβ”€β”€ config.py                  # Pydantic settings (.env)
β”œβ”€β”€ db.py                      # SQLite database (versioned migrations, typed rows)
└── types.py                   # Data classes

remotion/                      # Renderer (TypeScript)
└── src/                       # ShortubeVideo, Captions, SceneClip, bumpers,
                               # Transitions, SoundEffects, template.tsx
templates/                     # premium.json Β· clean.json

βš™οΈ Configuration Reference

All settings live in the desktop app (Settings tab) or .env. Most work with either.

🧠 LLM & Discovery

Setting Default Description
LLM_PROVIDER groq groq, openrouter, or ollama
LLM_MODEL llama-3.3-70b-versatile Script model
DISCOVERY_MODEL (inherits LLM_MODEL) Trend refinement model
LLM_TEMPERATURE 0.8 Creativity (0.0 – 1.5)
LLM_MAX_TOKENS 800 Max tokens per LLM call
GROQ_API_KEY β€” Groq key (required for groq)
OPENROUTER_API_KEY β€” OpenRouter key (required for openrouter)
OLLAMA_BASE_URL http://localhost:11434 Ollama server URL

πŸ“ Content & Niche

Setting Default Description
NICHE general_facts Default content niche
TAGS_DEFAULT shorts, youtubeshorts Fallback YouTube tags when a script has none
QUALITY standard fast, standard, or pro

πŸŽ™οΈ Voiceover

Setting Default Description
VOICE_NAME en-US-AriaNeural edge-tts voice
VOICE_SPEED 1.15 Playback speed
VOICE_VOLUME 1.0 Voiceover gain

🎞️ Video & Rendering

Setting Default Description
VIDEO_WIDTH / VIDEO_HEIGHT 1080 / 1920 Canvas size (px)
VIDEO_FPS 30 Baseline fps (presets may override)
BUMPER_DURATION 1.5 Intro/outro bumper length (s)
TRANSITION_DURATION 0.3 Scene transition length (s)
TEMPLATE premium Visual template from templates/*.json
REMOTION_PROJECT_DIR remotion Path to Remotion project
REMOTION_CONCURRENCY 0 Render threads (0 = preset default)
CAPTION_FONT_SIZE 48 Caption size (px)
CAPTION_FONT / CAPTION_FONT_COLOR β€” / white Caption font & color
CAPTION_STROKE_COLOR / WIDTH black / 3 Caption outline

πŸ–ΌοΈ Media & Audio

Setting Default Description
IMAGE_PROVIDER auto auto, pexels, pixabay, or pollinations
MEDIA_PREFER_VIDEOS true Prefer stock video clips over still images
PEXELS_API_KEY / PIXABAY_API_KEY β€” Stock media keys (optional)
BACKGROUND_MUSIC_PATH β€” Path to a music loop (optional)
MUSIC_VOLUME 15.0 Music level (0–100)
DUCK_THRESHOLD 6.0 Music ducking intensity
SFX_ENABLED true whoosh/pop/riser sound effects
SFX_DIR resources/sfx SFX folder

πŸ“€ YouTube Upload

Setting Default Description
YOUTUBE_CLIENT_SECRETS client_secrets.json OAuth client file
UPLOAD_PRIVACY public private, unlisted, or public
UPLOAD_CATEGORY 22 YouTube category ID
UPLOAD_LANGUAGE en Video language
UPLOAD_CHANNEL_ID β€” Default upload channel
UPLOAD_PUBLISH_AT β€” ISO 8601 scheduled publish time
UPLOAD_PLAYLIST_ID β€” Auto-add videos to a playlist

❓ FAQ

Is Shortube free? Yes. The software is MIT-licensed and free forever. You only pay for optional LLM API usage (Groq/OpenRouter) β€” or run it fully free with a local Ollama model.

Do I need to know how to edit video? No. Remotion renders the entire Short from a JSON template β€” captions, transitions, bumpers, and sound effects are all automated.

Which LLM providers are supported? Groq, OpenRouter, and Ollama β€” anything OpenAI-compatible. See the LLM Providers section.

Does it upload to YouTube automatically? Yes, via YouTube Data API v3 with OAuth 2.0. You can also use --dry-run or the desktop app to generate without uploading, and private/unlisted privacy modes are supported.

Can I schedule Shorts to publish at a specific time? Yes β€” both the built-in scheduler (generate on an interval with a daily cap) and YouTube's scheduled publishing (UPLOAD_PUBLISH_AT) are supported.

What happens if a render fails? The pipeline is resumable: cached script + storyboard + voiceover are reused, and rendering restarts from the last good stage. See How It Works.

Does it work on Windows, macOS, and Linux? The Python side is cross-platform. PyQt6 desktop app runs on all three; the Remotion renderer needs Node.js 18+.


🀝 Contributing

Found a bug or have an idea? Open an issue or submit a PR. See CONTRIBUTING.md for the full development guide; the CI pipeline runs the same gates locally:

python -m ruff check shortube tests   # lint
python -m pytest                      # unit tests (84+)

The real-render E2E smoke test is opt-in and needs Node.js + the Remotion deps installed:

cd remotion && npm install && cd ..
$env:SHORTUBE_E2E = "1"   # PowerShell (Linux/macOS: export SHORTUBE_E2E=1)
python -m pytest -m e2e

Other gates: python -m compileall -q shortube, npx tsc --noEmit in remotion/, and a Qt offscreen boot check of MainWindow.


πŸ“„ License

MIT β€” free to use, modify, and distribute, including commercially.


Made with ❀️ by alimaandev

πŸŽ₯ Shortube β€” the open-source YouTube Shorts generator that turns ideas into published Shorts, automatically.

⭐ Star the repo if you find it useful β€” it helps more people discover it.

About

AI-powered YouTube Shorts studio: trend discovery, LLM scripts, edge-tts voiceovers, Remotion assembly and auto-upload to YouTube

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages