A Streamlit web app to extract, summarize, translate, and interact with YouTube video transcripts using Gemini AI.
(Text-to-Voice feature coming soon!)
-
Extract YouTube Transcripts
- Enter any YouTube URL and fetch the transcript.
- Automatically grabs in the first available language.
- Handles long transcripts by chunking & summarizing in parts.
-
Summarize Transcript
- Get concise, bullet-point summaries powered by Gemini AI.
-
View Transcript
- Access the complete transcript in its original language directly from the sidebar.
-
Ask Questions
- Interactively ask about the video content.
- Receive AI-powered answers grounded in the transcript.
-
Multilingual Support
- Translate summaries and answers into 20+ languages via Gemini.
- UI elements (buttons, headings, prompts) are instantly translated with
deep-translator.
-
Interactive UI
- Clean Streamlit interface with spinners, sidebars, and buttons for smooth interaction.
-
Text-to-Voice (Coming Soon)
- Convert transcript summaries and answers into speech.
Streamlit: For building the interactive web frontend.youtube-transcript-api: To fetch YouTube video transcripts programmatically.google-generativeai (Gemini 2.0 Flash-Lite model): For summarization, translation, and question answering on video content. Model, rate, and token limits are configurable inconfig.py.deep-translator: For translating UI elements content into multiple languages.python-dotenv: Managing API keys securely.
-
Clone the repository:
git clone https://github.com/SaiSruthisri/YoutubeAssistant.git cd YoutubeAssistant -
Set up API keys:
- Create a
.envfile in the project root. - Add your Gemini API key:
GEMINI_API_KEY=your_gemini_api_key_here
- Create a
-
Install dependencies:
pip install -r requirements.txt
-
Run the app:
streamlit run app.py
- After running, open your browser and go to http://localhost:8501 to use the app live.
-
Choose Language:
Select your preferred language for the UI and output. -
Enter YouTube URL:
Paste a valid YouTube video URL in the input box. -
Load Transcript:
Click "Load Transcript" to fetch and summarize the transcript. -
Summarize the Video:
Click "📝Summarize the video" for a bullet-point summary. -
View Entire Transcript:
After loading, you can view the complete transcript in its original language from the sidebar. -
Ask Questions:
Type your question about the video and click "Ask" to get an AI-powered answer. -
Translate Transcript, Summary, and Answers:
- Summaries and answers are generated in English by Gemini, then translated to your chosen language using Gemini for high quality.
- UI elements (headings, buttons, prompts) are translated instantly using deep-translator for a native experience.
-
Text to Voice:
Feature coming soon !
Note: Since this is a Streamlit app, always use the buttons in the intended order (e.g., Load Transcript → Summarize → Ask) to avoid losing data on the screen. Switching between buttons or reloading may reset the app state and clear your previous results or questions.
- English, Hindi, French, Spanish, German, Telugu, Kannada, Tamil, Russian, Portuguese, Italian, Dutch, Arabic, Korean, Turkish, Vietnamese, Filipino, Japanese, Chinese
This project was made possible thanks to the following open-source libraries, documentation, and best practices:
- Streamlit
- youtube-transcript-api
- deep-translator
- google-generativeai
- python-dotenv
- Gemini API Rate Limiting: Read about Gemini model rate limits and quotas here
- Retry Strategies: Best practices for handling API retries and backoff are explained here