GitHunt
RY

ryma-tharouma/youtube-summarizer-with-gemma

a simple Streamlit app that summarizes the transcript of any YouTube video using google gemma 3 model.

๐ŸŽฅ YouTube Video Summarizer

Summarize YouTube videos effortlessly using Google Gemini (Gemma), automatic transcript extraction, and punctuation restoration. This lightweight Streamlit app transforms video content into clear and structured summaries with just a video link.


App Screenshot


๐Ÿš€ Features

  • ๐Ÿ”— Accepts any YouTube video URL format
  • ๐Ÿง  Choose between 3 summary types:
    • General โ€“ well-structured overview
    • Short โ€“ concise 5-line summary
    • Technical โ€“ structured insight for technical content
  • โœ๏ธ Restores punctuation to improve readability
  • ๐Ÿ’พ Download summary as a Markdown (.md) file
  • ๐Ÿ”’ Keeps your API key secure using .env

๐Ÿ“ฆ Installation

1. Clone the repository

git clone https://github.com/ryma-tharouma/youtube-summarizer-with-gemma.git
cd youtube-video-summarizer

2. Install dependencies

pip install -r requirements.txt

3. Add your Gemini API key

Create a .env file in the project root:

gemma3n_api_key=your_gemma_api_key_here

๐Ÿ”‘ Get your key from Google AI Studio


โ–ถ๏ธ Run the App

streamlit run app.py

๐Ÿง  How It Works

  • Extracts Video ID โ€“ using a robust regex-based function
  • Fetches Transcript โ€“ using YouTubeTranscriptApi
  • Restores Punctuation โ€“ with a multilingual punctuation model
  • Summarizes Content โ€“ with structured prompts using Gemini
  • Outputs โ€“ Markdown summary ready to view or download

โœ… Supported YouTube URLs

  • https://www.youtube.com/watch?v=VIDEO_ID
  • https://youtu.be/VIDEO_ID
  • https://m.youtube.com/watch?v=VIDEO_ID

๐Ÿ“‚ File Structure

.
โ”œโ”€โ”€ app.py
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ screenshots/
โ””โ”€โ”€ app_demo.png

๐Ÿงฐ Tech Stack

  • Python 3.8+
  • Streamlit
  • Google Generative AI (Gemma)
  • YouTubeTranscriptApi
  • DeepMultilingualPunctuation
  • python-dotenv