A Python tool that fetches YouTube video transcripts and uses Google's Gemini 2.5 Pro (via LangChain) to generate a short summary paragraph.
- Smart Summarization: Uses
gemini-2.5-profor high-quality summaries. - Transcript Fetching: robustly handles video URLs and IDs.
- Secure Authentication:
- Supports
.envfile forGOOGLE_API_KEY. - Interactively prompts for the key if missing (no hardcoding!).
- Supports
- Modern Tooling: Managed by
uvfor fast dependency resolution.
-
Clone the repository:
git clone <repository_url> cd YouTube-Video-Summarizer
-
Install dependencies:
uv sync # or uv pip install -r pyproject.toml
-
Set your API Key (Optional but recommended): Create a
.envfile in the root directory:GOOGLE_API_KEY=your_actual_api_key_here
-
Run the interactive tool:
uv run main.py
-
Interact:
- Paste the YouTube URL when prompted.
- View the summary.
- Ask follow-up questions in the chat interface.
- See "Suggested Questions" to explore the video further.
Type
exitorquitto end the session.
For a visual interface with persistent history:
uv run streamlit run app.py- Library Sidebar: Access past video chats.
- Rich Chat: Chat bubble interface.
- Persistence: automatically saves chat history to a local SQLite database.
- Smart Summarization: Uses
gemini-2.5-profor high-quality summaries. - Web GUI: Full-featured web chat with history sidebar.
- Interactive TUI: Beautiful terminal interface.
- Persistent Memory: Remembers your chats per video in
chat_history.db. - Auto-Suggestions: Get 3 relevant follow-up questions after every answer.
- Transcript Fetching: robustly handles video URLs and IDs.
- Secure Authentication: Supports
.envand secure prompts.