An interactive web application that allows users to ask questions about YouTube video content using AI-powered analysis of video subtitles.
Ask-YouTube is a Flask-based web application that extracts subtitles from YouTube videos and uses AI language models to answer questions about the video content. The application supports multiple AI providers including:
- Google Gemini
- OpenAI (ChatGPT)
- Ollama (for local AI models)
- Extract subtitles from any YouTube video with captions
- Process video content using advanced AI models
- Support for multiple AI providers (Gemini, OpenAI, Ollama)
- Save conversation history in session
- User-friendly web interface
- Secure API key management
-
Clone the repository:
git clone https://github.com/08anask/Ask-YouTube.git cd ask-youtube -
Install required dependencies:
pip install -r requirements.txt
-
If you want to use Ollama, make sure it's installed on your system. Visit Ollama's official website for installation instructions.
-
Start the application:
python app.py
-
Open your web browser and navigate to:
http://127.0.0.1:5000/ -
Enter a YouTube URL with available subtitles
-
Select your preferred AI provider and model
-
Ask questions about the video content
For Gemini and OpenAI, you'll need to provide your API keys:
- Click on the "API Key Settings" button in the navigation bar
- Select the AI model provider
- Enter your API key
- Save the settings
Note: Ollama runs locally and doesn't require an API key.
ask-youtube/
├── README.md
├── app.py # Main application file
├── requirements.txt # Required Python packages
└── templates/ # HTML templates
├── index.html # Main UI
└── settings.html # API key configuration
- The application extracts subtitles from YouTube videos using yt-dlp
- The extracted text is processed by the selected AI model via LangChain
- Users can ask questions about the video content
- The AI generates responses based on the video's subtitles
- Conversation history is stored in the session
- Gemini 1.5 Pro
- Gemini 1.5 Flash
- Gemini 2.0 Flash
- GPT-3.5 Turbo
- GPT-4o Mini
- O3 Mini
- O1 Mini
- GPT-4o
- Any locally installed Ollama model
- Flask: Web framework
- yt-dlp: YouTube subtitle extraction
- LangChain: AI model integration
- Bootstrap: Frontend styling
- JavaScript: Dynamic UI updates
- Flask
- yt-dlp
- requests
- json5
- openai
- langchain
- langchain-community
- langchain-google-genai
- langchain-openai
- ollama
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Only works with YouTube videos that have subtitles (auto-generated or manual)
- API key required for Gemini and OpenAI
- Response quality depends on the accuracy of video subtitles and AI model capabilities
For questions or feedback, please open an issue on the repository or contact the project maintainer.