Skip to content

csa7mdm/youtube-curator

Repository files navigation

πŸ“Ί YouTube Curator

AI-Powered YouTube Playlist Analyzer

Chrome Extension TypeScript React Vite OpenRouter License: MIT

Transform overwhelming YouTube playlists into actionable insights using AI.

Features β€’ Installation β€’ Usage β€’ Architecture β€’ API β€’ Contributing


🎯 What is YouTube Curator?

YouTube Curator is a Chrome extension that uses artificial intelligence to analyze YouTube playlists and provide intelligent recommendations. Instead of manually scanning through hundreds of videos, let AI categorize, summarize, and prioritize content for you.

The Problem

  • πŸ“š Playlists with 50+ videos are overwhelming
  • ⏰ No time to watch everything
  • πŸ” Hard to find the most relevant content
  • πŸ“‹ No way to understand playlist themes at a glance

The Solution

YouTube Curator automatically:

  • πŸ€– Scrapes video metadata from any YouTube playlist
  • 🧠 Analyzes content using AI (via OpenRouter)
  • πŸ“Š Categorizes videos by theme and topic
  • ⭐ Recommends which videos to watch first
  • πŸ“ Summarizes the entire playlist in seconds

✨ Features

Feature Description
πŸ”„ Auto-Scroll Scraping Automatically scrolls through lazy-loaded playlists to capture all videos
πŸ€– AI Analysis Uses OpenRouter API to access multiple LLM models (GPT-4, Claude, Gemini, etc.)
🏷️ Smart Categorization Groups videos by identified themes and topics
⭐ Priority Recommendations Suggests most valuable videos to watch first
πŸ“Š Visual Dashboard Beautiful dark-themed UI with progress indicators
πŸ’Ύ Persistent State Saves analysis results for later viewing
πŸ”§ Configurable Models Choose from free or paid AI models
πŸ”’ Privacy-First Your data stays local; only video titles go to AI

πŸš€ Installation

Prerequisites

  • Node.js 18+ and npm
  • Google Chrome browser
  • OpenRouter API Key (free tier available)

Quick Start

# Clone the repository
git clone https://github.com/yourusername/youtube-curator.git
cd youtube-curator

# Install dependencies
npm install

# Build for production
npm run build

Load in Chrome

  1. Open chrome://extensions in Chrome
  2. Enable "Developer mode" (top right toggle)
  3. Click "Load unpacked"
  4. Select the dist/ folder from this project
  5. Pin the extension to your toolbar

Get Your API Key

  1. Visit OpenRouter.ai
  2. Sign up (free) and create an API key
  3. Click the YouTube Curator extension icon β†’ Settings
  4. Paste your API key and click Save

πŸ“– Usage

Basic Workflow

1. Navigate to YouTube     β†’  Open any YouTube playlist page
2. Click Extension Icon    β†’  Opens the YouTube Curator popup
3. Click "Start Scan"      β†’  Extension scrolls and extracts videos
4. Wait for Analysis       β†’  AI processes video metadata
5. View Results            β†’  Browse categorized insights

Supported Playlists

  • βœ… Regular playlists (/playlist?list=...)
  • βœ… Watch Later playlist
  • βœ… Liked videos playlist
  • βœ… Channel playlists
  • ⚠️ Mix playlists (limited support)

Analysis Output

The AI provides:

  • Summary: One-paragraph overview of the playlist
  • Themes: Key topics with video counts
  • Categories: Grouped videos with rationale
  • Recommendations: Top videos to watch first with reasons

πŸ—οΈ Architecture

YouTube Curator follows a modular Chrome Extension architecture using Manifest V3:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        CHROME BROWSER                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    Messages    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚              │◄──────────────►│                          β”‚  β”‚
β”‚  β”‚    Popup     β”‚                β”‚   Background Service     β”‚  β”‚
β”‚  β”‚   (React)    β”‚                β”‚       Worker             β”‚  β”‚
β”‚  β”‚              β”‚                β”‚                          β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                               β”‚                 β”‚
β”‚                                               β”‚ Messages        β”‚
β”‚                                               β–Ό                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    Content Script                        β”‚   β”‚
β”‚  β”‚            (Runs in YouTube tab context)                 β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β”‚ HTTPS
                               β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   OpenRouter     β”‚
                    β”‚   API (AI)       β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Components

Component Technology Purpose
Popup React + TypeScript User interface and controls
Background Service Worker State management, AI communication
Content Script Vanilla TypeScript DOM scraping, scroll automation
Messaging Chrome Runtime API Type-safe inter-process communication

πŸ“ Project Structure

youtube-curator/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ popup/                    # React UI
β”‚   β”‚   β”œβ”€β”€ App.tsx              # Main app component
β”‚   β”‚   β”œβ”€β”€ components/          # UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ ScanButton.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ AnalysisResult.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SettingsPage.tsx
β”‚   β”‚   β”‚   └── ProgressIndicator.tsx
β”‚   β”‚   β”œβ”€β”€ styles.css           # Dark theme styling
β”‚   β”‚   └── main.tsx             # React entry point
β”‚   β”‚
β”‚   β”œβ”€β”€ background/
β”‚   β”‚   └── serviceWorker.ts     # Background orchestration
β”‚   β”‚
β”‚   β”œβ”€β”€ content/
β”‚   β”‚   └── youtubeScript.ts     # YouTube DOM interaction
β”‚   β”‚
β”‚   └── lib/                      # Shared modules
β”‚       β”œβ”€β”€ common/
β”‚       β”‚   β”œβ”€β”€ messaging.ts     # Type-safe messaging
β”‚       β”‚   └── types.ts         # TypeScript interfaces
β”‚       β”œβ”€β”€ ai/
β”‚       β”‚   └── openRouterClient.ts  # AI API client
β”‚       β”œβ”€β”€ settings/
β”‚       β”‚   └── storage.ts       # Chrome storage wrapper
β”‚       └── youtube-mechanics/
β”‚           β”œβ”€β”€ scroller.ts      # Infinite scroll handler
β”‚           └── parser.ts        # Video metadata extractor
β”‚
β”œβ”€β”€ public/
β”‚   └── icons/                   # Extension icons
β”‚
β”œβ”€β”€ manifest.json                # Chrome extension manifest
β”œβ”€β”€ vite.config.ts              # Vite + CRXJS configuration
β”œβ”€β”€ tsconfig.json               # TypeScript configuration
└── package.json                # Dependencies and scripts

πŸ”Œ API Reference

Message Types

The extension uses a type-safe messaging system:

interface MessageTypeMap {
    // Popup β†’ Background
    'START_SCAN': { tabId: number };
    'STOP_SCAN': {};
    'GET_STATE': {};
    'CLEAR_RESULTS': {};

    // Background β†’ Content Script
    'SCROLL_TO_BOTTOM': { selector: string };
    'PARSE_VIDEOS': { containerSelector: string };

    // Content Script β†’ Background
    'SCROLL_PROGRESS': { loaded: number; estimatedTotal: number };
    'VIDEOS_PARSED': { videos: VideoMetadata[] };

    // Background β†’ Popup
    'STATE_UPDATE': ExtensionState;
    'ANALYSIS_COMPLETE': { analysis: AnalysisResult };
}

Data Types

interface VideoMetadata {
    id: string;
    title: string;
    channel: string;
    duration: string;
    thumbnail: string;
    url: string;
}

interface AnalysisResult {
    summary: string;
    themes: Array<{ name: string; description: string; videoCount: number }>;
    categories: Array<{ name: string; rationale: string; videos: string[] }>;
    recommendations: Array<{ 
        videoId: string; 
        reason: string; 
        priority: 'high' | 'medium' | 'low' 
    }>;
}

πŸ› οΈ Development

Commands

# Development with hot reload
npm run dev

# Production build
npm run build

# Type checking
npm run typecheck

# Run tests
npm run test

Tech Stack

Development Tips

  1. Use npm run dev for hot-reload during development
  2. Check chrome://extensions β†’ "Errors" for debugging
  3. Use Chrome DevTools on the popup: right-click β†’ "Inspect"
  4. Background script logs appear in the service worker console

πŸ” Privacy & Security

  • βœ… No user tracking - Zero analytics or telemetry
  • βœ… Data stays local - Video data stored in Chrome's local storage
  • βœ… Minimal AI exposure - Only video titles and channels sent to AI
  • βœ… Your API key - You control and pay for AI usage
  • βœ… Open source - Audit the code yourself

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow existing TypeScript patterns
  • Add types for all new code
  • Test in Chrome before submitting
  • Update documentation for new features

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • OpenRouter for providing LLM API access
  • CRXJS for excellent Chrome extension tooling
  • Vite for blazing-fast builds

⬆ Back to Top

Made with ❀️ by developers who had too many videos in their Watch Later

About

AI-powered YouTube playlist analyzer Chrome extension. Uses OpenRouter to access GPT-4, Claude, Gemini and other LLMs for intelligent video categorization and recommendations.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors