A Python tool that uses Google's Gemini API to automatically summarize YouTube videos.
- 🎥 Summarize any YouTube video using AI
- 🌐 Multi-language support (Chinese, Spanish, French, etc.)
- 🚀 Support for multiple Gemini models
- 🎨 Beautiful CLI output with progress indicators
- 💾 Save summaries to file
- 🔧 Custom prompt support
- 🔐 Environment variable support for API keys
- Install dependencies:
pip install -r requirements.txt- Set up your Gemini API key:
- Copy
.env.exampleto.env - Add your Gemini API key to the
.envfile - Or set it as an environment variable:
export GEMINI_API_KEY=your_key_here
- Copy
python youtube_summarizer.py "https://www.youtube.com/watch?v=VIDEO_ID"python youtube_summarizer.py "https://www.youtube.com/watch?v=VIDEO_ID" --prompt "Summarize this video in 3 bullet points"python youtube_summarizer.py "https://www.youtube.com/watch?v=VIDEO_ID" -o summary.txtpython youtube_summarizer.py "https://www.youtube.com/watch?v=VIDEO_ID" --model gemini-2.5-flash# Chinese
python youtube_summarizer.py "https://www.youtube.com/watch?v=VIDEO_ID" --lang zh
python youtube_summarizer.py "https://www.youtube.com/watch?v=VIDEO_ID" --lang chinese
# Spanish
python youtube_summarizer.py "https://www.youtube.com/watch?v=VIDEO_ID" --lang spanish
# French
python youtube_summarizer.py "https://www.youtube.com/watch?v=VIDEO_ID" -l frpython youtube_summarizer.py "https://www.youtube.com/watch?v=VIDEO_ID" --api-key YOUR_API_KEY- Summarize a tech tutorial:
python youtube_summarizer.py "https://www.youtube.com/watch?v=dQw4w9WgXcQ" \
--prompt "Extract the main steps and technical concepts from this tutorial"- Get key takeaways from a lecture:
python youtube_summarizer.py "https://youtu.be/VIDEO_ID" \
--prompt "List the main concepts discussed and any important definitions"- Create study notes:
python youtube_summarizer.py "https://youtube.com/watch?v=VIDEO_ID" \
--prompt "Create detailed study notes with headings and bullet points" \
-o lecture_notes.txt- Get summary in Chinese:
python youtube_summarizer.py "https://youtube.com/watch?v=VIDEO_ID" \
--lang zh \
-o chinese_summary.txt- Combine custom prompt with language:
python youtube_summarizer.py "https://youtube.com/watch?v=VIDEO_ID" \
--lang chinese \
--prompt "用三个要点总结这个视频的核心内容"https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://youtube.com/watch?v=VIDEO_ID&t=123shttps://www.youtube.com/embed/VIDEO_ID
The tool supports multiple output languages. Use the --lang or -l flag:
- Chinese:
zh,cn,chinese - English:
en,english(default) - Spanish:
es,spanish - French:
fr,french - German:
de,german - Japanese:
ja,japanese - Korean:
ko,korean - Or specify any other language by name
- Python 3.8+
- Valid Gemini API key
- Internet connection
- The tool uses
gemini-2.5-flashmodel by default (fast and efficient) - For more detailed summaries, you can specify different models with
--modelflag - API usage is subject to Google's rate limits and pricing