π€ AutoTube - Automated YouTube Shorts Factory
Fully automated YouTube Shorts creation system using n8n, AI image generation, and video processing
AutoTube is a complete automation pipeline for generating, creating, and publishing YouTube Shorts using AI. It combines n8n workflow automation, AI-powered script generation, dynamic image slideshows, text-to-speech, and video editing into one powerful system.
β¨ Features
- π¬ End-to-End Automation: From topic to published video, fully automated
- π§ AI Script Generation: Uses Ollama/LLaMA for engaging script writing
- π¨ AI Image Slideshows: Generates multiple AI images per video using Pollinations.ai or Z-Image
- ποΈ Professional Video Creation: Ken Burns zoom effects, crossfade transitions, text overlays
- π Text-to-Speech: OpenTTS for natural voiceovers
- π€ YouTube Upload: Direct upload to YouTube with metadata
- π³ Docker-Based: All services containerized for easy deployment
- π n8n Workflow: Visual automation with error handling and monitoring
ποΈ Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AutoTube System β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββ βββββββββββ ββββββββββββ ββββββββββββ β
β β n8n ββββΆβ Ollama ββββΆβ Python ββββΆβ YouTube β β
β β Workflow β β AI β β Video APIβ β API β β
β ββββββββββββ βββββββββββ ββββββββββββ ββββββββββββ β
β β β β β β
β β β β β β
β βΌ βΌ βΌ βΌ β
β ββββββββββββ βββββββββββ ββββββββββββ ββββββββββββ β
β βPostgreSQLβ β OpenTTS β β AI β β Redis β β
β β DB β β Voice β β Images β β Cache β β
β ββββββββββββ βββββββββββ ββββββββββββ ββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
System Components
| Component | Purpose | Port |
|---|---|---|
| n8n | Workflow automation orchestrator | 5678 |
| Ollama | Local AI for script generation (LLaMA 3.1) | 11434 |
| OpenTTS | Text-to-speech conversion | 5500 |
| Python API | Video creation & AI image generation | 5001 |
| PostgreSQL | n8n database | 5432 |
| Redis | Caching layer | 6379 |
| FileBrowser | File management UI | 8080 |
π Quick Start
Prerequisites
- Docker Desktop (Windows/Mac) or Docker Engine (Linux)
- Docker Compose v2.0+
- Git
- 4GB RAM minimum (8GB recommended)
- 10GB free disk space
Installation
-
Clone the repository
git clone https://github.com/Hritikraj8804/Autotube.git cd Autotube -
Configure environment variables
cd short_automation cp .env.example .envEdit
.envand set:N8N_BASIC_AUTH_ACTIVE=true [email protected] N8N_BASIC_AUTH_PASSWORD=your_secure_password N8N_ENCRYPTION_KEY=generate-a-random-key-here POSTGRES_PASSWORD=your_secure_db_password -
Start the system
Windows:
START-ROBOT.batLinux/Mac:
cd short_automation docker-compose up -d -
Access services
- n8n Dashboard: http://localhost:5678
- File Browser: http://localhost:8080
- AI Server: http://localhost:11434
-
Import the workflow
- Open n8n at http://localhost:5678
- Click Workflows β Import from File
- Select
short_automation/workflows/autotube-complete.json - Activate the workflow
-
Download AI model
docker exec youtube-ai ollama pull llama3.1:8b
π Usage
Creating Your First Video
- Open n8n at http://localhost:5678
- Find the AutoTube workflow and open it
- Configure the Manual Trigger node with your video topic:
{ "topic": "Top 5 AI Tools in 2025" } - Click "Test Workflow" and watch the magic happen!
How It Works
- Script Generation: AI generates a 30-second script with hook, content, and CTA
- Image Creation: Multiple AI images are generated based on script sections
- Voice Generation: Text-to-speech creates professional voiceover
- Video Compilation: Images are assembled with transitions, zoom effects, and text overlays
- YouTube Upload: Video is uploaded with title, description, and tags
Video Specifications
- Format: Vertical 9:16 (1080x1920)
- Duration: ~30 seconds (YouTube Shorts)
- FPS: 30
- Effects: Ken Burns zoom, crossfade transitions
- Audio: OpenTTS voice synthesis
βοΈ Configuration
Environment Variables
Create a .env file in the short_automation directory:
# n8n Authentication
N8N_BASIC_AUTH_ACTIVE=true
[email protected]
N8N_BASIC_AUTH_PASSWORD=your_secure_password
# Encryption
N8N_ENCRYPTION_KEY=your-random-32-char-key
# Database
POSTGRES_USER=n8n
POSTGRES_PASSWORD=your_secure_db_password
POSTGRES_DB=n8n
# Optional: HuggingFace token for Z-Image (better quality)
HUGGINGFACE_TOKEN=your_hf_token_here
YouTube API Setup
- Create a project in Google Cloud Console
- Enable YouTube Data API v3
- Create OAuth 2.0 credentials
- Download credentials as
client_secret_*.json - Place in
short_automation/directory (already gitignored)
AI Image Generation
AutoTube supports two AI image providers:
Pollinations.ai (Default - Free, Unlimited)
- No API key required
- Good quality
- Fast generation
- Already configured
Z-Image via HuggingFace (Better Quality)
- Requires free HuggingFace account
- Set
HUGGINGFACE_TOKENin.env - Edit workflow to enable Z-Image
π οΈ Development
Project Structure
Autotube/
βββ short_automation/
β βββ docker-compose.yml # Service definitions
β βββ .env.example # Environment template
β βββ workflows/ # n8n workflow files
β β βββ autotube-complete.json
β βββ scripts/ # Python automation
β β βββ ai_generator.py # AI image generation
β β βββ create_video.py # Video creation
β β βββ video_api.py # Flask API server
β βββ videos/ # Generated content (gitignored)
β βββ data/ # Persistent data (gitignored)
βββ START-ROBOT.bat # Windows start script
βββ STOP-ROBOT.bat # Windows stop script
βββ TEST-ALL.bat # Service testing script
βββ docs/ # Documentation
βββ README.md # This file
Python API Endpoints
The Python video API runs on http://localhost:5001:
GET /health- Health checkPOST /generate- Generate videoGET /info- API information
Example Request:
curl -X POST http://localhost:5001/generate \
-H "Content-Type: application/json" \
-d '{
"hook": "Did you know?",
"content": "Amazing facts here",
"cta": "Follow for more!",
"title": "Cool Video",
"useAiImages": true
}'
Local Development
-
Install Python dependencies
docker exec youtube-python pip install -r /scripts/requirements.txt -
Test video generation
docker exec youtube-python python /scripts/create_video.py -
View logs
docker-compose logs -f
π Troubleshooting
Services won't start
# Check Docker is running
docker ps
# Restart all services
docker-compose down
docker-compose up -d
# Check logs
docker-compose logs
n8n won't connect
- Verify port 5678 is not in use
- Check
.envfile is configured correctly - Wait 30 seconds after startup for initialization
AI model not found
docker exec youtube-ai ollama pull llama3.1:8b
Video generation fails
- Check Python container is running:
docker ps - Verify videos directory is writable
- Check logs:
docker logs youtube-python
More troubleshooting
See docs/TROUBLESHOOTING.md for detailed solutions.
π Documentation
- Architecture Overview
- Detailed Setup Guide
- n8n Workflow Guide
- Python API Documentation
- Troubleshooting
π€ Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Quick Contribution Guide
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- n8n - Workflow automation platform
- Ollama - Local AI inference
- Pollinations.ai - Free AI image generation
- OpenTTS - Text-to-speech engine
- MoviePy - Video editing library
- YouTube API - Video publishing
π Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
πΊοΈ Roadmap
- [ ] Support for multiple AI models (GPT-4, Claude, Gemini)
- [ ] Advanced video editing (effects, filters)
- [ ] Thumbnail generation
- [ ] Multi-language support
- [ ] Scheduled posting
- [ ] Analytics dashboard
- [ ] Music integration
- [ ] Custom brand templates
Made with β€οΈ by the AutoTube team
Star β this repo if you find it useful!