Filter YouTube videos by views, upload date, duration, keywords, and channels, with watched video dimming and customizable profiles.
A powerful userscript to filter YouTube videos by views, upload date, duration, keywords, and channels, with watched video dimming/greyout and customizable preset profiles. Fully optimized for both desktop and mobile viewports. YouTube Shorts are preserved.
dist/youtube-filter.user.js.m.youtube.com / Phone screens $\le 480\text{px}$):
width: min(320px, 92vw)).ytm-video-with-context-renderer, ytm-compact-video-renderer, ytm-reel-item-renderer, ytm-rich-item-renderer).Default — Clean baseline profile.+ Save Profile — Save your current custom filters as a reusable named profile.Dim (Default) — Greys out videos you've already watched ($\ge 70\%$ red progress bar) with $25\%$ opacity + grayscale. Hover over or tap any dimmed video to smoothly un-dim and inspect.Hide — Completely hides watched videos.Off — Disables watched video detection.prank, reaction, /trailer$/i) and press Enter or , to add tag chips.10K, 1.5M, or 1000000. Includes inline > 100K and > 1M quick chips.YYYY-MM-DD pickers with validation.< 15m and > 20m quick chips.require-trusted-types-for 'script') with zero innerHTML sinks.yt-lockup-view-model, ytd-rich-item-renderer, and mobile ytm-* elements.#0f0f0f, #212121, #ff4d4d red close buttons) and YouTube SVG icons.requestAnimationFrame for buttery-smooth scrolling on long feeds./shorts/, ytd-reel-item-renderer, ytm-reel-item-renderer) are never hidden.yt-navigate-finish, yt-page-data-updated, and history events across YouTube page transitions.Infinity $\leftrightarrow$ null JSON roundtripping seamlessly.Built with TypeScript, Vite, vite-plugin-monkey, Bun, and tested with Playwright Stealth (Desktop + Mobile).
# Install dependencies
bun install
# Start local dev server with auto-rebuild
bun run dev
# Run unit tests (happy-dom)
bun run test:unit
# Run end-to-end tests on live YouTube (Playwright Stealth: Desktop & Mobile)
bun run test:e2e
# Run all test suites
bun run test
# Type check
bun run tsc
# Build production bundle (outputs to dist/youtube-filter.user.js)
bun run build