- Created project structure following new standardized layout - Added FastAPI-based main application - Configured requirements with YouTube and AI integrations - Added comprehensive README documentation - Set up environment configuration template |
||
|---|---|---|
| src | ||
| .env.example | ||
| .gitignore | ||
| README.md | ||
| requirements.txt | ||
README.md
YouTube Summarizer Web Application
An AI-powered web application that automatically extracts, transcribes, and summarizes YouTube videos, providing intelligent insights and key takeaways.
🎯 Features
- Video Transcript Extraction: Automatically fetch transcripts from YouTube videos
- AI-Powered Summarization: Generate concise summaries using multiple AI models
- Multi-Model Support: Choose between OpenAI GPT, Anthropic Claude, or DeepSeek
- Key Points Extraction: Identify and highlight main topics and insights
- Chapter Generation: Automatically create timestamped chapters
- Export Options: Save summaries as Markdown, PDF, or plain text
- Caching System: Reduce API calls with intelligent caching
- Rate Limiting: Built-in protection against API overuse
🏗️ Architecture
[Web Interface] → [FastAPI Backend] → [YouTube API/Transcript API]
↓
[AI Service] ← [Summary Generation] ← [Transcript Processing]
↓
[Database Cache] → [Summary Storage] → [Export Service]
🚀 Quick Start
Prerequisites
- Python 3.11+
- YouTube API Key (optional but recommended)
- At least one AI service API key (OpenAI, Anthropic, or DeepSeek)
Installation
- Clone the repository
git clone https://eniasgit.zeabur.app/demo/youtube-summarizer.git
cd youtube-summarizer
- Set up virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
- Configure environment
cp .env.example .env
# Edit .env with your API keys and configuration
- Initialize database
alembic init alembic
alembic revision --autogenerate -m "Initial migration"
alembic upgrade head
- Run the application
python src/main.py
The application will be available at http://localhost:8082
📁 Project Structure
youtube-summarizer/
├── src/
│ ├── api/ # API endpoints
│ │ ├── routes.py # Main API routes
│ │ └── websocket.py # Real-time updates
│ ├── services/ # Business logic
│ │ ├── youtube.py # YouTube integration
│ │ ├── summarizer.py # AI summarization
│ │ └── cache.py # Caching service
│ ├── utils/ # Utility functions
│ │ ├── validators.py # Input validation
│ │ └── formatters.py # Output formatting
│ └── main.py # Application entry point
├── tests/ # Test suite
├── docs/ # Documentation
├── alembic/ # Database migrations
├── static/ # Frontend assets
├── templates/ # HTML templates
├── requirements.txt # Python dependencies
├── .env.example # Environment template
└── README.md # This file
🔧 Configuration
Essential Environment Variables
| Variable | Description | Required |
|---|---|---|
YOUTUBE_API_KEY |
YouTube Data API v3 key | Optional* |
OPENAI_API_KEY |
OpenAI API key | One of these |
ANTHROPIC_API_KEY |
Anthropic Claude API key | is required |
DEEPSEEK_API_KEY |
DeepSeek API key | for AI |
DATABASE_URL |
Database connection string | Yes |
SECRET_KEY |
Session secret key | Yes |
*YouTube API key improves metadata fetching but transcript extraction works without it.
🧪 Testing
Run the test suite:
pytest tests/ -v
pytest tests/ --cov=src --cov-report=html # With coverage
📝 API Documentation
Once running, visit:
- Interactive API docs:
http://localhost:8082/docs - Alternative docs:
http://localhost:8082/redoc
Key Endpoints
POST /api/summarize- Submit a YouTube URL for summarizationGET /api/summary/{id}- Retrieve a summaryGET /api/summaries- List all summariesPOST /api/export/{id}- Export summary in different formats
🚢 Deployment
Docker
docker build -t youtube-summarizer .
docker run -p 8082:8082 --env-file .env youtube-summarizer
Production Considerations
- Use PostgreSQL instead of SQLite for production
- Configure proper CORS settings
- Set up SSL/TLS certificates
- Implement user authentication
- Configure rate limiting per user
- Set up monitoring and logging
🤝 Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
📄 License
This project is part of the Personal AI Assistant ecosystem.
🔗 Related Projects
📞 Support
For issues and questions, please create an issue in the repository.