AI-powered YouTube Shorts creation tool built with Next.js 15. Automatically extract, edit, and upload 9:16 vertical clips with captions, hooks, and AI-generated metadata.
- 🎥 YouTube Video Download - Download any YouTube video using ytdl-core
- ✂️ Smart Clipping - Extract clips with custom length and timestamps
- 📐 9:16 Conversion - Automatic vertical format conversion for Shorts
- 💬 Auto Captions - AI-powered caption generation using Whisper
- 🤖 AI Metadata - Generate hooks, titles, tags, and descriptions with Gemini AI
- 📤 Auto Upload - Direct upload to YouTube Shorts
- 🔐 OAuth2 Authentication - Secure YouTube account connection
- 📊 Upload History - Track all your generated clips
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS + Radix UI
- Database: PostgreSQL with Drizzle ORM (Neon)
- Video Processing: ytdl-core + fluent-ffmpeg
- AI Services:
- Google Gemini 2.0 (metadata generation)
- OpenAI Whisper (caption extraction)
- Authentication: NextAuth v5 with YouTube OAuth2
- YouTube API: googleapis (Data API v3)
- Node.js 18.17+
- FFmpeg installed on your system
- PostgreSQL database (Neon recommended)
- API Keys:
- Google Cloud (YouTube Data API + OAuth2)
- Google AI Studio (Gemini API)
- OpenAI (Whisper API)
# Clone the repository
git clone https://github.com/EslamSad3/yt-shorts-clipper.git
cd yt-shorts-clipper
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your API keys
# Run database migrations
npm run db:push
# Start development server
npm run devOpen http://localhost:3000 in your browser.
- Go to Google Cloud Console
- Create a new project
- Enable YouTube Data API v3
- Create OAuth 2.0 credentials
- Add authorized redirect URI:
http://localhost:3000/api/auth/callback/youtube - Copy Client ID and Client Secret to
.env
- Visit Google AI Studio
- Generate API key
- Add to
.envasGEMINI_API_KEY
- Get API key from OpenAI Platform
- Add to
.envasOPENAI_API_KEY
- Create a Neon PostgreSQL database
- Copy connection string to
.envasDATABASE_URL - Run migrations:
npm run db:push
- Connect YouTube Account: Sign in with your YouTube account via OAuth2
- Paste Video URL: Enter any YouTube video link
- Select Clip Duration: Choose length (15s, 30s, 60s, or custom)
- Customize Settings:
- Enable/disable captions
- Choose caption style
- Set clipping position
- Generate AI Metadata: Let Gemini create hooks, titles, and tags
- Preview & Edit: Review the clip before uploading
- Upload to YouTube: Automatically publish as a Short
├── app/
│ ├── api/ # API routes
│ │ ├── auth/ # YouTube OAuth
│ │ ├── video/ # Video processing
│ │ ├── captions/ # Caption generation
│ │ ├── ai/ # Gemini AI integration
│ │ └── upload/ # YouTube upload
│ ├── dashboard/ # Main app UI
│ └── layout.tsx
├── components/
│ ├── ui/ # Radix UI components
│ ├── video-editor/ # Clipping interface
│ └── upload-queue/ # Upload management
├── lib/
│ ├── db/ # Database schema
│ ├── youtube.ts # YouTube API client
│ ├── gemini.ts # Gemini AI client
│ └── ffmpeg.ts # Video processing utils
└── types/ # TypeScript types
POST /api/video/download- Download YouTube videoPOST /api/video/clip- Create 9:16 clipPOST /api/captions/generate- Extract captions with WhisperPOST /api/ai/metadata- Generate titles/tags with GeminiPOST /api/upload/youtube- Upload Short to YouTubeGET /api/auth/status- Check OAuth status
See .env.example for all required environment variables.
vercel deployFor video processing, consider:
- Render - Full-stack hosting with persistent storage
- Railway - Easy deployment with FFmpeg support
- AWS Lambda - Serverless with FFmpeg layer
Note: Video processing requires FFmpeg. Most serverless platforms need custom layers.
- Batch processing multiple clips
- Advanced caption styling (fonts, colors, animations)
- Multi-language caption support
- TikTok & Instagram Reels upload
- AI-powered clip detection (highlight extraction)
- Analytics dashboard
- Whop marketplace integration
MIT License - See LICENSE for details
Pull requests are welcome! For major changes, please open an issue first.
For issues and questions:
- GitHub Issues: Report a bug
- Email: eslamcontact3@gmail.com
Built with ❤️ for content creators