A full-stack Flask application that extracts subtitles from YouTube videos and generates key points using AI models.
- π¬ Extract subtitles from any YouTube video with available transcripts
- π Language Selection: Choose from available subtitle languages with detailed information
- π Language Detection: Automatically detect all available subtitle languages
- π·οΈ Language Info: Shows auto-generated vs manual subtitles and translatability
- π§ AI-Powered Key Points: Generate key insights using Groq API with multiple AI models
- π¨ Modern, responsive web interface with glassmorphism design
- π Copy transcript and key points to clipboard
- π Real-time loading indicators with smooth animations
- π± Fully responsive design for all devices
- π RESTful API endpoints
- Llama 4 Scout 17B: Faster processing for quick key point generation
- Llama 3.3 70B: More accurate analysis for detailed insights
pip install -r requirements.txtOr install manually:
pip install Flask youtube-transcript-api python-dotenv requestsCreate a .env file in the project root:
GROQ_API_KEY=your_groq_api_key_hereGet your Groq API key from: https://console.groq.com/
Create the following directory structure:
youtube-subtitle-extractor/
βββ app.py
βββ requirements.txt
βββ .env
βββ templates/
β βββ index.html
βββ static/ (auto-created)
python app.pyThe application will be available at: http://localhost:5000
- Open your browser and go to
http://localhost:5000 - Enter a YouTube URL in the input field
- Click "Check Languages" to see available subtitle languages
- Select your preferred language from the grid of options
- Click "Extract Subtitles" to get the transcript
- Choose an AI model and click "Generate Key Points" for AI-powered insights
- Copy transcript or key points to clipboard as needed
POST /api/languages
Request body:
{
"url": "https://www.youtube.com/watch?v=VIDEO_ID"
}Response:
{
"video_id": "VIDEO_ID",
"languages": [
{
"language_code": "en",
"language": "English",
"is_generated": true,
"is_translatable": true
}
],
"success": true
}POST /api/transcript
Request body:
{
"url": "https://www.youtube.com/watch?v=VIDEO_ID",
"language_code": "en"
}Response:
{
"video_id": "VIDEO_ID",
"transcript": "Full transcript text...",
"language_code": "en",
"success": true
}POST /api/keypoints
Request body:
{
"transcript": "Full transcript text...",
"model": "meta-llama/llama-4-scout-17b-16e-instruct"
}Response:
{
"key_points": "Generated key points...",
"model": "meta-llama/llama-4-scout-17b-16e-instruct",
"success": true
}GET /api/health
Response:
{
"status": "healthy"
}https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://www.youtube.com/embed/VIDEO_IDhttps://www.youtube.com/watch?v=VIDEO_ID&other_params
- Visual Language Grid: Interactive grid showing all available languages
- Language Metadata:
- Auto-generated vs manual subtitles
- Translatable indicators
- Language codes and full names
- Smart Selection: Radio button selection with visual feedback
- Fallback Support: Automatic fallback to default language if selected language fails
The application integrates with Groq API to generate intelligent key points:
- Multiple Models: Choose between speed (Llama 4 Scout) and accuracy (Llama 3.3 70B)
- Formatted Output: AI-generated points are formatted with proper HTML rendering
- Indonesian Support: Prompts in Indonesian for localized key point generation
- Error Handling: Robust error handling for API failures
- Glassmorphism Design: Modern glass-like aesthetic with backdrop blur
- Smooth Animations: Loading spinners, hover effects, and transitions
- Interactive Elements: Copy buttons with success/error notifications
- SweetAlert2 Integration: Beautiful toast notifications for user feedback
- Responsive Layout: Works seamlessly on desktop, tablet, and mobile
- Color-Coded Sections: Different color schemes for transcript vs key points
Comprehensive error handling for:
- Invalid YouTube URLs
- Videos without available transcripts
- Selected language not available
- Private or restricted videos
- Network errors
- Groq API failures
- Malformed requests
- Invalid AI model selection
Flask>=2.0.0
youtube-transcript-api>=0.5.0
python-dotenv>=0.19.0
requests>=2.28.0
- Groq API: For AI-powered key point generation
- YouTube: For video transcript extraction
- Only works with videos that have available transcripts/subtitles
- Supports both manual and auto-generated subtitles
- AI key point generation requires valid Groq API key
- Indonesian language prompts are used for key point generation
- The transcript is returned as plain text without timestamps
- Key points are formatted with HTML for better presentation
- All data is processed in-memory (no persistent storage)
Feel free to submit issues and enhancement requests!
This project is open source and available under the MIT License.
