A powerful Chrome extension that analyzes YouTube video context using transcript extraction, comment analysis, and RAG (Retrieval-Augmented Generation). Now supports both standard YouTube videos and YouTube Shorts!
- Transcript Extraction: Automatically extracts video transcripts using YouTube API or direct page extraction
- Multi-Language Caption Support: Fetches and analyzes captions in multiple languages for comprehensive analysis
- YouTube Shorts Support: Works with both standard YouTube videos (
/watch?v=) and YouTube Shorts (/shorts/) - Browser Player Extraction: Fallback extraction directly from YouTube player when API is unavailable
- Sentiment Analysis: Analyzes video comments for sentiment and key themes
- Batch Processing: Configurable comment batch sizes for optimal performance
- Comment Filtering: Supports limiting total comments analyzed
- Multiple LLM Providers: Support for OpenAI, Hugging Face, Gemini, and Ollama
- Question Answering: Ask questions about video content and get answers based on the transcript
- Fact Checking: Select text and right-click to fact-check claims in the video
- Intelligent Chunking: Configurable transcript chunk sizes for better processing
- Well-supported languages: English, Spanish, French, German, Japanese, Korean, Chinese, Arabic, Hindi, Portuguese, Russian, Italian, Dutch, Swedish, Danish, Norwegian, Finnish, Turkish, Polish, Ukrainian
- Indian languages: Tamil, Telugu, Bengali, Malayalam, Kannada, Gujarati, Punjabi, Marathi, Urdu (
β οΈ limited auto-caption support) - Other languages: Thai, Vietnamese, Indonesian, Malay, Hebrew, Persian (some with limited support)
- Result Caching: Improved performance with intelligent result caching
- Export Results: Download analysis results as HTML or text files
- Keyboard Shortcuts: Convenient keyboard shortcuts for common actions
- Progress Tracking: Visual progress indicators for all operations
- Manual Mode: Option to manually input transcripts when automatic extraction fails
-
Clone or download this repository
git clone https://github.com/Rishpraveen/Youtube_Context_Analysis_using_API.git
-
Load the extension in Chrome
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right corner
- Click "Load unpacked" and select the folder containing this extension
- Open Chrome and navigate to
-
Configure API keys
- Click the extension icon to open the popup
- Go to options and configure your API keys (see API Setup below)
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the YouTube Data API v3
- Create credentials (API key)
- Copy and paste the API key in the extension options
Option 1: OpenAI API Key
- Go to OpenAI API Keys
- Create an account or log in
- Create a new secret key
- Copy and paste the key in the extension options
Option 2: Hugging Face API Key (Free Alternative)
- Go to Hugging Face
- Create an account or log in
- Create a new access token
- Copy and paste the token in the extension options
Option 3: Google Gemini API Key (Free Tier Available)
- Go to Google AI Studio
- Create an account or log in
- Create a new API key
- Copy and paste the key in the extension options
Option 4: Ollama (Completely Free, Local Option)
- Install Ollama on your local machine
- Start the Ollama server
- Configure the endpoint URL (default:
http://localhost:11434) - Select your preferred model in the extension options
- Navigate to any YouTube video or Short
- Click the extension icon
- Go to the "Transcript" tab
- Click "Get Transcript" or use Ctrl+T
- View extracted transcripts in multiple languages (if available)
- In the "Comments" tab
- Click "Analyze Comments" or use Ctrl+C
- Configure batch size and maximum comments in options for optimal performance
- View sentiment analysis and key themes
- Go to the "RAG Analysis" tab
- Enter your question about the video content
- Use Ctrl+R to focus on the query input
- Get AI-powered answers based on the transcript
- Ctrl+1: Switch to Transcript tab
- Ctrl+2: Switch to Comments tab
- Ctrl+3: Switch to RAG Analysis tab
- T: Get transcript (when in Transcript tab)
- C: Analyze comments (when in Comments tab)
- R: Focus on RAG query input (when in RAG tab)
Use the download buttons next to each analysis section:
- Transcript: Exports as a text file (.txt)
- Comment Analysis: Exports as an HTML report
- RAG Analysis: Exports as an HTML report
- Comment Batch Size: Controls how many comments are processed at once (lower = less RAM usage)
- Max Comments: Limits total comments to analyze (lower = faster processing)
- Chunk Size: Size of transcript chunks for RAG (smaller = less memory usage)
- Fetch All Languages: When enabled, fetches captions in all available languages
- Preferred Languages: Select languages in order of preference (when "Fetch All Languages" is disabled)
- Auto-Generated Translations: Include auto-translated captions (may be less accurate)
If automatic transcript extraction fails:
- Go to extension options
- Enable "Use Manual Mode"
- Optionally paste a default transcript
- When using the extension, you'll be prompted to paste the transcript manually
- Standard YouTube Videos:
https://www.youtube.com/watch?v=VIDEO_ID - YouTube Shorts:
https://www.youtube.com/shorts/VIDEO_ID
The extension automatically detects the video format and extracts the video ID accordingly.
When the YouTube API doesn't have captions for certain languages:
- Automatic Fallback: Enabled by default, triggers when API extraction fails
- Real-time Extraction: Captures captions as they appear in the player
- Multi-language Support: Can extract multiple languages sequentially
- Manual Control: Can be disabled in settings if not desired
- Transcripts are cached for 1 hour
- Analysis results are cached based on the selected API provider
- Cache is automatically cleaned to prevent excessive memory usage
We welcome contributions! Please see our Contributing Guidelines for details on:
- How to report bugs
- How to suggest features
- How to submit pull requests
- Code style guidelines
For security concerns, please see our Security Policy.
This project is licensed under the MIT License - see the LICENSE file for details.
If you find this project useful, please consider:
- β Starring this repository
- π Reporting bugs through Issues
- π‘ Suggesting new features
- π Sharing with others
API Keys Not Working
- Use the "Test API" buttons in options to verify your keys
High Memory Usage
- Reduce batch size and chunk size in the options
Transcript Extraction Fails
- Switch to manual mode and paste the transcript manually
- Check if the video has captions available
Extension Closing
- This has been fixed in recent updates - popup now stays open during operations
Slow Analysis
- Enable caching and consider using a more efficient API provider
- Reduce the number of comments being analyzed
YouTube Shorts Issues
- Ensure you're on a valid YouTube video or Short page
- Extension now supports both
/watch?v=and/shorts/URLs
Video ID Not Detected
- Make sure you're on
youtube.com/watch?v=oryoutube.com/shorts/URLs - Refresh the page and try again
This extension only processes data for the currently active YouTube video. No data is stored on external servers, and API keys are stored locally in your browser.
- JavaScript - Core functionality
- Chrome Extension APIs - Browser integration
- YouTube Data API v3 - Video and transcript data
- Multiple AI APIs - OpenAI, Hugging Face, Gemini, Ollama
- RAG Technology - Retrieval-Augmented Generation
- Chrome Web Store (Coming Soon)
- Issues
- Discussions
Made with β€οΈ by Rishpraveen
β‘ Powered by AI β’ π― Built for Researchers β’ π Multi-language Ready