Filter YouTube recommendations using a local LLM. Keep videos aligned with your goals. Block distractions automatically.
Requirements: Ollama running locally
- Clone or download this repo
- Open
brave://extensionsorchrome://extensions - Enable "Developer mode"
- Click "Load unpacked" and select this folder
brew install ollama
OLLAMA_ORIGINS="*" ollama serve
ollama pull llama3.2:3bThe OLLAMA_ORIGINS="*" is required for the extension to communicate with Ollama.
| Step | What Happens |
|---|---|
| 1 | Extension detects video thumbnails on YouTube |
| 2 | Extracts title, channel, description |
| 3 | Sends to local Ollama for evaluation |
| 4 | LLM classifies as FOCUS, ALLOW, or BLOCK |
| 5 | Videos filtered based on classification |
All processing happens locally. No data leaves your machine.
Click the extension icon to open the popup with 4 tabs:
Home Tab
| Setting | Description |
|---|---|
| Enable/Disable | Master toggle for filtering |
| Strict Mode | Only show FOCUS videos, hide ALLOW |
Focus Tab
| Setting | Description |
|---|---|
| Profiles | Save multiple goal configurations |
| Goals | Describe what you want to focus on |
| Templates | Quick-start presets for common use cases |
Settings Tab
| Setting | Description |
|---|---|
| Ollama URL | Default: http://localhost:11434 |
| Model | Default: llama3.2:3b |
| Always Allow | Channels to whitelist |
| Always Block | Channels to blacklist |
Be specific. Include both what you want AND what distracts you.
Bad:
I want to learn and be productive
Good:
Learning TypeScript, React, system design. Working on a SaaS startup.
Block: gaming, celebrity drama, political rants, mukbangs, prank videos, reaction content.
The LLM classifies each video into three categories:
| Classification | Meaning | Visibility |
|---|---|---|
| FOCUS | Directly relevant to your goals | Always shown (gold highlight) |
| ALLOW | Not distracting, but not directly relevant | Shown (hidden in Strict Mode) |
| BLOCK | Distracting content | Always hidden |
Rules the LLM follows:
- FOCUS if directly relevant to what you want to learn/do
- ALLOW if educational, informative, or generally useful
- ALLOW if ambiguous — doesn't over-block
- BLOCK if clearly entertainment, drama, gossip, clickbait
- BLOCK if unrelated to focus AND not educational
Strict Mode: Enable to hide ALLOW videos and only show FOCUS content.
| Location | Selector | Status |
|---|---|---|
| Homepage | ytd-rich-item-renderer |
✅ |
| Search Results | ytd-video-renderer |
✅ |
| Watch Page Sidebar | yt-lockup-view-model |
✅ |
| Shorts Shelf | ytd-reel-item-renderer |
✅ |
Extension shows "Ollama not running"
Start Ollama with CORS enabled:
OLLAMA_ORIGINS="*" ollama serveVideos not being filtered
- Check console for
[YouTube Focus Filter]logs - Run
ytffDebug.status()in console - Run
ytffDebug.checkSelectors()to verify elements found
All videos showing (not filtering)
- Ensure you've set goals in the extension popup
- Check Ollama is running:
curl http://localhost:11434/api/tags - Clear cache and re-evaluate from popup
Wrong videos being blocked
- Refine your goals to be more specific
- Use whitelist for channels you always want
- Click "Clear Cache & Re-evaluate" after changing goals
Open browser console on YouTube and run:
ytffDebug.status() // Check extension state
ytffDebug.checkSelectors() // Verify video elements found
ytffDebug.listVideos() // List all detected videos
ytffDebug.forceProcess() // Manually trigger evaluationyoutube-focus-filter/
├── manifest.json # Extension manifest (MV3)
├── background.js # Service worker
├── content-scripts/
│ ├── youtube.js # DOM manipulation
│ └── youtube.css # Loading/error states
├── popup/
│ ├── popup.html
│ ├── popup.js
│ └── popup.css
├── lib/
│ ├── ollama.js # Ollama API client
│ └── cache.js # IndexedDB cache
└── icons/
- All processing happens locally via Ollama
- No data sent to external servers
- No analytics or tracking
- Video decisions cached locally for 24 hours
MIT