Skip to content

krishn1122/YouTube-Video-Summerizer

Repository files navigation

πŸ“Ή YouTube Video Summarizer

Python Streamlit Google Gemini License PRs Welcome

Transform YouTube videos into concise, insightful summaries powered by Google Gemini AI

πŸš€ Quick Start β€’ ✨ Features β€’ πŸ“– Documentation β€’ 🀝 Contributing

Demo Screenshot


🌟 Overview

YouTube Video Summarizer is an AI-powered web application that automatically extracts transcripts from YouTube videos and generates comprehensive summaries using Google's Gemini 1.5 Flash model. Perfect for researchers, students, content creators, and anyone who wants to quickly understand video content without watching the entire video.

✨ Features

🎯 Core Functionality

  • πŸ” Smart Transcript Extraction - Multiple fallback methods ensure reliability
  • πŸ€– AI-Powered Summarization - Google Gemini 1.5 Flash generates intelligent summaries
  • πŸ“Ί Video Preview - Embedded YouTube player for context
  • πŸ’Ύ Export Summaries - Download summaries as text files
  • πŸ”„ Manual Fallback - Always works even when auto-extraction fails

πŸš€ User Experience

  • ⚑ One-Click Setup - Platform-specific installation scripts
  • 🎨 Clean Interface - Modern Streamlit-powered web UI
  • πŸ“± Responsive Design - Works on desktop and mobile
  • πŸ”— URL Validation - Smart YouTube URL format detection
  • πŸ“Š Progress Indicators - Real-time processing status

πŸ›‘οΈ Reliability

  • πŸ”„ Multi-Method Extraction - YouTube API β†’ LangChain β†’ Manual input
  • ⚠️ Error Handling - Comprehensive error messages and recovery
  • 🎯 Rate Limiting - Built-in API quota management
  • πŸ”’ Secure Configuration - Environment-based API key management

πŸš€ Quick Start

Prerequisites

  • Python 3.8 or higher
  • Google API key (free tier available)
  • Internet connection

1. Clone Repository

git clone https://github.com/yourusername/youtube-video-summarizer.git
cd youtube-video-summarizer

2. Get Google API Key

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Click "Create API Key"
  4. Copy the generated key

3. Configure Environment

Create a .env file in the project root:

GOOGLE_API_KEY="your_actual_google_api_key_here"

4. Run Application

Option 1: One-Click Setup (Recommended)

  • Windows: Double-click setup_and_run.bat
  • Linux/Mac: Run bash setup_and_run.sh

Option 2: Manual Setup

# Install dependencies
pip install -r requirements.txt

# Run the application
streamlit run app.py

5. Access Application

Open your browser and navigate to: http://localhost:8501

πŸ“– Documentation

πŸ—οΈ How It Works

graph TB
    A[YouTube URL Input] --> B[URL Validation]
    B --> C[Video ID Extraction]
    C --> D[Transcript Extraction]
    D --> E[YouTube API]
    E --> F{Success?}
    F -->|Yes| G[AI Processing]
    F -->|No| H[LangChain Fallback]
    H --> I{Success?}
    I -->|Yes| G
    I -->|No| J[Manual Input]
    J --> G
    G --> K[Gemini 1.5 Flash]
    K --> L[Generated Summary]
    L --> M[Display Results]
    M --> N[Download Option]
Loading

πŸ”§ Tech Stack

Component Technology Version
Frontend Streamlit 1.28+
AI Model Google Gemini 1.5 Flash
Backend Python 3.8+
API Integration LangChain Latest
Video Processing YouTube Transcript API 0.6.0+
Environment python-dotenv 1.0.0+

πŸ“‹ System Requirements

streamlit>=1.28.0
python-dotenv>=1.0.0
langchain>=0.1.0
langchain-community>=0.0.20
langchain-google-genai>=1.0.0
youtube-transcript-api>=0.6.0
requests>=2.31.0

πŸ†“ Google Gemini Free Tier

  • βœ… 15 requests/minute
  • βœ… 1,500 requests/day
  • βœ… 1M tokens/month
  • βœ… Perfect for personal use!

🎯 Usage Examples

Basic Usage

  1. Launch the application
  2. Paste a YouTube URL (e.g., https://www.youtube.com/watch?v=dQw4w9WgXcQ)
  3. Click "πŸš€ Summarize Video"
  4. Wait for processing (usually 10-30 seconds)
  5. View the AI-generated summary
  6. Download the summary if needed

Advanced Features

  • Manual Transcript Input: If auto-extraction fails, paste transcript manually
  • Multiple Video Formats: Supports various YouTube URL formats
  • Batch Processing: Process multiple videos in sequence

🚨 Troubleshooting

πŸ”‘ API Key Issues

Problem: "GOOGLE_API_KEY not configured" error

Solutions:

  1. Ensure .env file exists in project root
  2. Verify API key is correctly set without quotes issues
  3. Get a new key from Google AI Studio
  4. Check for extra spaces or special characters
πŸ“Ί No Transcript Found

Problem: "No transcripts found" error

Solutions:

  1. Ensure video has captions/subtitles enabled
  2. Try with a different public video
  3. Use the manual transcript input option
  4. Check if video is region-restricted
πŸ”§ Installation Issues

Problem: Package installation failures

Solutions:

# Update pip first
pip install --upgrade pip

# Install with specific versions
pip install streamlit==1.28.0 langchain-google-genai==1.0.0

# Use virtual environment
python -m venv venv
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate     # Windows
pip install -r requirements.txt
🌐 Network Issues

Problem: Connection timeouts or network errors

Solutions:

  1. Check internet connection
  2. Try different video (some may be geo-blocked)
  3. Wait and retry (YouTube API temporary issues)
  4. Use VPN if regional restrictions apply

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

πŸ”„ Development Setup

# Clone repository
git clone https://github.com/yourusername/youtube-video-summarizer.git
cd youtube-video-summarizer

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate     # Windows

# Install development dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt

# Run tests
pytest tests/

# Run application
streamlit run app.py

πŸ› Reporting Issues

  1. Check existing issues
  2. Create a new issue
  3. Use appropriate issue template
  4. Provide detailed information and steps to reproduce

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Google AI for the powerful Gemini 1.5 Flash model
  • Streamlit for the amazing web framework
  • LangChain for AI integration capabilities
  • YouTube Transcript API for reliable transcript extraction
  • Contributors who help improve this project

πŸ“ž Support


⭐ Star this repository if it helped you! ⭐

GitHub stars GitHub forks

Built with ❀️ using Streamlit, LangChain, and Google Gemini

About

YouTube Video Summarizer is an AI-powered web application that automatically extracts transcripts from YouTube videos and generates comprehensive summaries using Google's Gemini 1.5 Flash model.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors