Chat with any YouTube video using AI - Extract transcripts and have intelligent conversations
Demo β’ Features β’ Quick Start β’ Usage β’ API
π¬ Paste YouTube URL β π€ AI processes transcript β π¬ Chat about video content
Example Conversation:
User: "What are the main points discussed in this video?"
AI: "Based on the transcript, the video covers 3 main topics: ..."
User: "Can you explain the concept mentioned at 5:30?"
AI: "At that timestamp, the speaker discusses ..."
| Feature | Description |
|---|---|
| π₯ Video Processing | Extract transcripts from any YouTube video with captions |
| π€ AI Chat | Powered by Google Gemini 1.5 Flash for intelligent responses |
| π Smart Search | Find relevant video segments with text-based search |
| β‘ Fast & Simple | No complex databases or vector embeddings required |
| π Web Interface | Clean, responsive UI with real-time chat |
| π Cost Effective | No quota limits or embedding costs |
- Python 3.8+
- Google AI API Key (Get one free)
-
Clone & Navigate
git clone https://github.com/Ayush-AM/Dev.git cd 2_youtube_chat_app -
Setup Environment
# Windows python -m venv venv venv\Scripts\activate # macOS/Linux python3 -m venv venv source venv/bin/activate
-
Install Dependencies
pip install -r requirements.txt
-
Configure API Key
# Create .env file echo GOOGLE_API_KEY="your_api_key_here" > .env
-
Launch App
python application.py
-
Open Browser
http://127.0.0.1:5001
-
π Enter YouTube URL
- Paste any YouTube video URL with captions/subtitles
- Supports:
youtube.com/watch?v=...oryoutu.be/...
-
βοΈ Process Video
- Click "Process Video" button
- Wait for "Video processed successfully!" message
-
π¬ Start Chatting
- Ask questions about video content
- Get AI-powered responses with context
| Query Type | Example |
|---|---|
| Summary | "What are the key takeaways from this video?" |
| Specific Topic | "Explain the concept mentioned at 10:30" |
| Analysis | "What's the speaker's main argument?" |
| Details | "List all the tools mentioned in the video" |
2_youtube_chat_app/
βββ π application.py # Main Flask app (Production Ready)
βββ π app.py # Advanced RAG version (Future)
βββ π agent.py # Pinecone integration
βββ π simple_agent.py # Lightweight agent
βββ π templates/
β βββ π index.html # Web interface
βββ π requirements.txt # Dependencies
βββ π requirements_simple.txt # Minimal dependencies
βββ π .env # Environment variables (ignored)
βββ π .gitignore # Git ignore rules
βββ π README.md # Documentation
| Component | Technology | Purpose |
|---|---|---|
| Frontend | HTML/CSS/JavaScript | Clean, responsive UI |
| Backend | Flask | Lightweight web framework |
| AI Model | Google Gemini 1.5 Flash | Natural language processing |
| Transcript | YouTube Transcript API | Video text extraction |
| Search | Text-based matching | Fast content retrieval |
| Storage | In-memory | No database required |
graph TD
A[YouTube URL] --> B[Transcript Extraction]
B --> C[Text Processing]
C --> D[Gemini AI]
D --> E[Chat Response]
E --> F[Web Interface]
β "No transcript available"
Cause: Video doesn't have captions/subtitles
Solutions:
- β Use videos with auto-generated captions
- β Try educational/tutorial videos (usually have captions)
- β Check if captions are enabled on YouTube
π "API Key Error"
Cause: Invalid or missing Google API key
Solutions:
- β
Verify API key in
.envfile - β Get new key from Google AI Studio
- β Check API key permissions
- β
Ensure no extra spaces in
.env
πͺ "Port already in use"
Cause: Another process using port 5001
Solutions:
- β
Change port:
app.run(port=5002)inapplication.py - β
Kill existing process:
taskkill /f /im python.exe(Windows) - β
Use different port:
python application.py --port 5002
π¦ "Module not found"
Cause: Missing dependencies or virtual environment
Solutions:
- β
Activate virtual environment:
venv\Scripts\activate - β
Reinstall:
pip install -r requirements.txt - β
Check Python version:
python --version(3.8+ required)
| Feature | Status |
|---|---|
| Basic transcript extraction | β Complete |
| Gemini AI integration | β Complete |
| Web interface | β Complete |
| Text-based search | β Complete |
| Zero setup complexity | β Complete |
| Feature | Status |
|---|---|
| Vector embeddings | π In Progress |
| Pinecone integration | π Planned |
| Advanced RAG | π Planned |
| Semantic search | π Planned |
| Multi-video chat | π Planned |
- Python: 3.8 or higher
- API Key: Google AI (free tier available)
- Internet: Required for YouTube access
- Videos: Must have captions/subtitles
We welcome contributions! Here's how:
- π΄ Fork the repository
- πΏ Create a feature branch:
git checkout -b feature/amazing-feature - πΎ Commit changes:
git commit -m 'Add amazing feature' - π€ Push to branch:
git push origin feature/amazing-feature - π Open a Pull Request
- π Bug fixes
- β¨ New features
- π Documentation improvements
- π§ͺ Test coverage
- π¨ UI/UX enhancements
This project is licensed under the MIT License - see the LICENSE file for details.
- π Issues: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
- π§ Contact: Create an issue for support
If this project helped you, please consider:
- β Starring the repository
- π Reporting bugs
- π‘ Suggesting features
- π€ Contributing code
Built with β€οΈ using Google Gemini AI