This is a simple LLM-based YouTube Summarizer project using Google's Gemini-1.5-Flash model. The app fetches YouTube transcripts and summarizes them using the LLM, presented via a Streamlit interface.
⚠️ Note: You must run this project locally because YouTube may block requests originating from cloud servers.
- Summarizes YouTube videos using state-of-the-art LLM
- Uses Google Gemini model via API
- Streamlit-based interactive web interface
- Easily configurable with
.env
variables
Follow these steps to get the project up and running on your local system:
-
Clone the repo or create a new project folder in your local system using your preferred IDE or code editor.
-
Open the terminal in the project directory and create a virtual environment:
python -m venv venv
it will create virtual environmental files in your project folder.
-
Create a
.env
file in the root directory to store environment variables like your Google API Key.-
Get your API key from Google AI Studio.
-
Add this line to your
.env
file:GOOGLE_API_KEY="your_google_api_key_here"
-
-
Create a
requirements.txt
file and include all required packages. Example:youtube_transcript_api streamlit google-generativeai python-dotenv pathlib
-
Activate the virtual environment:
-
On Windows:
.\venv\Scripts\activate
-
On macOS/Linux:
source venv/bin/activate
-
-
Install all dependencies:
pip install -r requirements.txt
-
Create your main Python file (e.g.,
app.py
) and copy the main code into it.- Before running, make sure to:
- Load environment variables correctly using
dotenv
. - Set your preferred Google model.
- Customize the HTML/CSS/Streamlit UI as needed.
- Load environment variables correctly using
- Before running, make sure to:
-
Run the Streamlit app:
streamlit run app.py
This project uses gemini-1.5-flash
(or other Gemini variants) to generate the summary. You can choose an appropriate model from Google's Gemini Models Documentation.
youtube-summarizer/
│
├── .env
├── app.py
├── requirements.txt
└── venv/
- Do NOT upload your
.env
file to GitHub. Add it to your.gitignore
. - Always test locally, as some YouTube endpoints block cloud-based IP addresses.
- Use your own API quota wisely, as summarizing long transcripts can consume tokens quickly.
- The prompt already given in the code and it limited to 250 words.
- Google AI for the Gemini model
- Streamlit for the UI framework
- YouTube Transcript API for fetching transcripts
- Edureka for project overview
Feel free to open an issue or pull request if you have ideas or improvements! Happy coding 🚀