Skip to content

muneeracodes/youtube-summarizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 YouTube Summarizer

Paste any YouTube URL β€” get an intelligent summary in seconds.

Supports any language Β· Full playlists Β· 4 summary styles Β· Timestamped key moments

Live Demo Backend API License

App Screenshot(/frontend/src/assets/Screenshot02.png)


🧠 The Problem It Solves

People waste hours watching long YouTube videos just to extract a few key points. Creators post hour-long tutorials, lectures, and podcasts β€” but viewers often only need the core idea in 2 minutes.

YouTube Summarizer solves this by turning any YouTube video or playlist into a clean, structured summary β€” in seconds, in any language.


✨ Features

  • 4 Summary Styles β€” Bullet points, short (3–5 sentences), detailed, or timestamped key moments
  • Multilingual β€” Auto-detects spoken language (Urdu, Hindi, Spanish, etc.), always outputs English
  • Playlist Support β€” Summarizes up to 10 videos in a playlist with a combined overview
  • Smart Transcript Pipeline β€” Uses YouTube captions first (instant), falls back to Groq Whisper AI only when needed
  • Long Video Support β€” Automatically chunks transcripts so even hour-long videos work
  • In-Memory Cache β€” Same video won't be re-processed, responses are instant on repeat
  • Download Summaries β€” Save any summary as a .txt file

πŸ—οΈ How It Works

YouTube URL
     β”‚
     β–Ό
 FastAPI Backend (Render)
     β”‚
     β”œβ”€β”€ Step 1: youtube-transcript-api ──► Captions found β†’ instant transcript βœ…
     β”‚                                      (no download, no FFmpeg, works everywhere)
     β”‚
     └── Step 2: Groq Whisper (fallback) ──► No captions? Download audio β†’ transcribe
     β”‚
     β–Ό
 Chunk long transcripts (prevents LLM context overflow)
     β”‚
     β–Ό
 Groq LLaMA 3.3 70B (summarize with chosen style)
     β”‚
     β–Ό
 React Frontend (Vercel) ──► Display + Download

Why not just use yt-dlp for everything? YouTube actively blocks audio downloads from cloud server IPs (Render, Railway, etc.). Using youtube-transcript-api as the primary method means the app reliably works in production. Whisper is kept as a real fallback for videos that genuinely have no captions.


πŸ› οΈ Tech Stack

Layer Technology
Frontend React 18 + Vite
Backend FastAPI + Python 3.11
Transcription (primary) youtube-transcript-api β€” no download needed
Transcription (fallback) Groq Whisper whisper-large-v3
Summarization Groq LLaMA 3.3 llama-3.3-70b-versatile
Backend hosting Render.com (Docker)
Frontend hosting Vercel

πŸ“ Project Structure

youtube-summarizer/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py                   # FastAPI app, routes, in-memory cache
β”‚   β”œβ”€β”€ pipeline/
β”‚   β”‚   β”œβ”€β”€ transcript.py         # youtube-transcript-api (primary method)
β”‚   β”‚   β”œβ”€β”€ whisper_fallback.py   # Groq Whisper (fallback for no-caption videos)
β”‚   β”‚   β”œβ”€β”€ summarizer.py         # LLaMA 3.3 + transcript chunking logic
β”‚   β”‚   └── utils.py              # URL parsing, video ID extraction, playlist helpers
β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── .env.example
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.jsx               # Main UI component
β”‚   β”‚   └── App.css               # Dark theme styling
β”‚   β”œβ”€β”€ package.json
β”‚   └── .env.example
β”œβ”€β”€ render.yaml                   # Render deployment config
└── README.md

πŸš€ Run Locally

Prerequisites

1. Clone the repo

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

2. Backend

cd backend
python -m venv venv

# Windows
venv\Scripts\activate
# Mac/Linux
source venv/bin/activate

pip install -r requirements.txt
cp .env.example .env
# Edit .env β†’ add your GROQ_API_KEY

uvicorn main:app --reload
# β†’ http://localhost:8000

3. Frontend

cd frontend
npm install
cp .env.example .env.local
# Edit .env.local β†’ set VITE_API_URL=http://localhost:8000

npm run dev
# β†’ http://localhost:5173

☁️ Deploy Your Own

Backend β†’ Render.com

  1. Go to render.com β†’ New β†’ Web Service
  2. Connect your GitHub repo
  3. Set Root Directory β†’ backend
  4. Set Environment β†’ Docker
  5. Add env var: GROQ_API_KEY = your key
  6. Add env var: ALLOWED_ORIGINS = your Vercel URL
  7. Deploy β†’ copy the service URL

Frontend β†’ Vercel

  1. Go to vercel.com β†’ Add New Project β†’ import repo
  2. Set Root Directory β†’ frontend
  3. Add env var: VITE_API_URL = your Render URL
  4. Deploy

πŸ”‘ Environment Variables

Backend (backend/.env)

Variable Required Description
GROQ_API_KEY βœ… Free at console.groq.com
ALLOWED_ORIGINS βœ… Your Vercel URL (for CORS)

Frontend (frontend/.env.local)

Variable Required Description
VITE_API_URL βœ… Your Render backend URL

πŸ“¬ API Reference

POST /summarize

{
  "url": "https://www.youtube.com/watch?v=VIDEO_ID",
  "style": "bullets"
}

Styles: bullets Β· short Β· detailed Β· timestamps

Response:

{
  "video_id": "VIDEO_ID",
  "title": "Video Title",
  "summary": "- Key point one\n- Key point two...",
  "transcript_method": "captions",
  "cached": false
}

POST /summarize/playlist

{
  "url": "https://www.youtube.com/playlist?list=PLAYLIST_ID",
  "style": "short"
}

GET /health

Returns { "status": "ok" } β€” used by Render for health checks.


πŸ‘©β€πŸ’» Author

Muneera Ibrahim LinkedIn GitHub

About

An intelligent, full-stack analytical pipeline designed to transcribe and synthesize long-form YouTube content and multi-video playlists into crisp, actionable markdown summaries, key insights, and structured chronological timestamp markers.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors