A complete Node.js application that automatically generates and uploads YouTube Shorts using only free and open-source tools.
Node.js (v16 or higher)
node --version
FFmpeg (for video processing)
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt update && sudo apt install ffmpeg
Windows Setup (Recommended) Run the setup script as Administrator:
# Open PowerShell as Administrator and run:
Set-ExecutionPolicy Bypass -Scope Process -Force
.\setup-tts-windows.ps1
This will install:
Manual Installation (Alternative)
HuggingFace API Key (Required for AI and Cloud TTS)
.env as HUGGINGFACE_API_KEYPexels API Key
YouTube Data API
Clone the repository
git clone https://github.com/yourusername/youtube-shorts-automation.git
cd youtube-shorts-automation
Run the setup script (Windows)
# Run as Administrator
.\setup-tts-windows.ps1
This will install all required dependencies and verify the setup.
Environment Setup
cp .env.example .env
# Edit .env with your API keys
Create Required Directories
mkdir -p temp/audio temp/videos temp/output
Optional: Install Piper TTS
mkdir piper
cd piper
# Download Piper for your platform:
# https://github.com/rhasspy/piper/releases
# Download a voice model (example):
mkdir models
cd models
wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx
wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx.json
Start the Server
npm start
# or for development
npm run dev
Open Dashboard
Generate Shorts
Monitor Progress
βββ server.js # Main Express server
βββ services/
β βββ ai.js # HuggingFace text generation
β βββ tts.js # Piper TTS integration
β βββ video.js # FFmpeg video assembly
β βββ youtube.js # YouTube Data API
β βββ pexels.js # Stock video fetching
βββ public/
β βββ index.html # Dashboard UI
β βββ script.js # Frontend JavaScript
βββ routes/
β βββ api.js # API routes and testing
βββ temp/ # Temporary files (auto-created)
βββ audio/ # Generated TTS files
βββ videos/ # Downloaded stock videos
βββ output/ # Final assembled videos
| Variable | Description | Required |
|---|---|---|
HUGGINGFACE_API_KEY | HuggingFace inference API key | Yes |
PEXELS_API_KEY | Pexels stock video API key | Yes |
YOUTUBE_CLIENT_ID | YouTube OAuth client ID | Yes |
YOUTUBE_CLIENT_SECRET | YouTube OAuth client secret | Yes |
YOUTUBE_REDIRECT_URI | OAuth redirect URI | No |
PORT | Server port | No |
TTS Not Working
espeak --versionffmpeg -version.envFFmpeg not found
# Linux
sudo apt install ffmpeg
# macOS
brew install ffmpeg
# Windows
# Download from https://ffmpeg.org/download.html
Piper TTS not working
YouTube authentication fails
Pexels videos not downloading
MIT License - Feel free to modify and distribute
# 1. Install dependencies
npm install
# 2. Set up environment
cp .env.example .env
# Edit .env with your API keys
# 3. Start the server
npm start
# 4. Open http://localhost:3000
# 5. Authenticate with YouTube
# 6. Generate your first Short!
π¬ Ready to create viral YouTube Shorts automatically!
7 commits
JavaScript
87.9%
HTML
8.1%
Python
2.9%
A complete Node.js application that automatically generates and uploads YouTube Shorts using only free and open-source tools.
Node.js (v16 or higher)
node --version
FFmpeg (for video processing)
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt update && sudo apt install ffmpeg
Windows Setup (Recommended) Run the setup script as Administrator:
# Open PowerShell as Administrator and run:
Set-ExecutionPolicy Bypass -Scope Process -Force
.\setup-tts-windows.ps1
This will install:
Manual Installation (Alternative)
HuggingFace API Key (Required for AI and Cloud TTS)
.env as HUGGINGFACE_API_KEYPexels API Key
YouTube Data API
Clone the repository
git clone https://github.com/yourusername/youtube-shorts-automation.git
cd youtube-shorts-automation
Run the setup script (Windows)
# Run as Administrator
.\setup-tts-windows.ps1
This will install all required dependencies and verify the setup.
Environment Setup
cp .env.example .env
# Edit .env with your API keys
Create Required Directories
mkdir -p temp/audio temp/videos temp/output
Optional: Install Piper TTS
mkdir piper
cd piper
# Download Piper for your platform:
# https://github.com/rhasspy/piper/releases
# Download a voice model (example):
mkdir models
cd models
wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx
wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx.json
Start the Server
npm start
# or for development
npm run dev
Open Dashboard
Generate Shorts
Monitor Progress
βββ server.js # Main Express server
βββ services/
β βββ ai.js # HuggingFace text generation
β βββ tts.js # Piper TTS integration
β βββ video.js # FFmpeg video assembly
β βββ youtube.js # YouTube Data API
β βββ pexels.js # Stock video fetching
βββ public/
β βββ index.html # Dashboard UI
β βββ script.js # Frontend JavaScript
βββ routes/
β βββ api.js # API routes and testing
βββ temp/ # Temporary files (auto-created)
βββ audio/ # Generated TTS files
βββ videos/ # Downloaded stock videos
βββ output/ # Final assembled videos
| Variable | Description | Required |
|---|---|---|
HUGGINGFACE_API_KEY | HuggingFace inference API key | Yes |
PEXELS_API_KEY | Pexels stock video API key | Yes |
YOUTUBE_CLIENT_ID | YouTube OAuth client ID | Yes |
YOUTUBE_CLIENT_SECRET | YouTube OAuth client secret | Yes |
YOUTUBE_REDIRECT_URI | OAuth redirect URI | No |
PORT | Server port | No |
TTS Not Working
espeak --versionffmpeg -version.envFFmpeg not found
# Linux
sudo apt install ffmpeg
# macOS
brew install ffmpeg
# Windows
# Download from https://ffmpeg.org/download.html
Piper TTS not working
YouTube authentication fails
Pexels videos not downloading
MIT License - Feel free to modify and distribute
# 1. Install dependencies
npm install
# 2. Set up environment
cp .env.example .env
# Edit .env with your API keys
# 3. Start the server
npm start
# 4. Open http://localhost:3000
# 5. Authenticate with YouTube
# 6. Generate your first Short!
π¬ Ready to create viral YouTube Shorts automatically!
7 commits
JavaScript
87.9%
HTML
8.1%
Python
2.9%