Skip to content

thisisjaymehta/YoutubeBlocker

Repository files navigation

YouTube Educational Filter

A Chrome/Firefox extension that blocks non-educational YouTube videos using a local LLM (LM Studio) to analyze video content.

Features

  • 🎓 AI-Powered Classification - Uses local LLM to determine if videos are educational
  • 🚫 Blocks Shorts - Automatically blocks YouTube Shorts
  • 🔄 Auto-Redirect - Redirects non-educational videos to YouTube homepage
  • ⚙️ Customizable Prompt - Modify the AI classification prompt to your needs
  • 💾 Smart Caching - Caches results to avoid repeated API calls
  • 🌐 Cross-Browser - Works on both Chrome and Firefox

Requirements

  • Google Chrome or Mozilla Firefox browser
  • LM Studio running locally with a model loaded

Installation

Chrome

  1. Clone this repository:

    git clone https://github.com/YOUR_USERNAME/YoutubeBlocker.git
  2. Open Chrome and navigate to chrome://extensions/

  3. Enable "Developer mode" (toggle in top right)

  4. Click "Load unpacked" and select the cloned folder

Firefox

  1. Clone this repository:

    git clone https://github.com/YOUR_USERNAME/YoutubeBlocker.git
  2. Rename the manifest file:

    # In the cloned folder, replace manifest.json with Firefox version
    mv manifest.json manifest.chrome.json
    mv manifest.firefox.json manifest.json
  3. Open Firefox and navigate to about:debugging#/runtime/this-firefox

  4. Click "Load Temporary Add-on..."

  5. Select the manifest.json file from the cloned folder

Note: For permanent Firefox installation, the extension needs to be signed by Mozilla or installed in Firefox Developer/Nightly with xpinstall.signatures.required set to false.

Setup

  1. Download and install LM Studio

  2. Load a model in LM Studio (recommended: any instruction-following model)

  3. Start the local server in LM Studio (default: http://localhost:1234)

  4. Click the extension icon in Chrome to configure:

    • API URL: LM Studio endpoint (default: http://localhost:1234/v1/chat/completions)
    • Enable Extension: Toggle the filter on/off
    • Block All Shorts: Toggle Shorts blocking
    • Classification Prompt: Customize how videos are evaluated
  5. Click "Test Connection" to verify LM Studio is reachable

How It Works

  1. When you visit a YouTube video, the extension extracts:

    • Video title
    • Channel name
    • Video description
  2. This metadata is sent to your local LLM with a classification prompt

  3. The LLM responds with "EDUCATIONAL" or "NOT_EDUCATIONAL"

  4. Non-educational videos are blocked and you're redirected to YouTube homepage

Customizing the Prompt

You can customize the classification prompt in the extension settings. Use these placeholders:

  • {title} - Video title
  • {channel} - Channel name
  • {description} - Video description

Privacy

  • All processing happens locally on your machine
  • No data is sent to external servers
  • Video metadata is only sent to your local LM Studio instance

License

MIT License

About

Chrome extension that blocks non-educational YouTube videos using local LLM (LM Studio)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors