Skip to content

masone/yt-ad-skip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yt-ad-skip

Auto-skip in-video ads and sponsor segments - think AI-powered SponsorBlock without the manual work.

A Chrome extension + server that uses LLM analysis of video captions to detect and automatically skip sponsor reads, affiliate promotions, cross-promos, and other ad segments in YouTube videos. Currently in POC state.

How it works

Chrome Extension                Server (:3001)
┌──────────────┐                ┌──────────────────────┐
│ content.ts   │──videoId──→    │ POST /segments/:id   │
│  detects YT  │                │   ↓                  │
│  video, auto │                │ yt-dlp fetches VTT   │
│  skips ads   │                │ captions              │
│              │                │   ↓                  │
│ background.ts│←─ad blocks──   │ GPT-4o analyzes      │
│  fetch proxy │  via poll      │ transcript for ads    │
│              │                │   ↓                  │
│ popup.html   │                │ GET /segments/:id    │
│  shows found │                │   → cached result    │
│  segments    │                └──────────────────────┘
└──────────────┘
  1. Extension detects the YouTube video ID
  2. Sends it to the local server, which fetches captions via yt-dlp
  3. GPT-4o analyzes the transcript to find ad/sponsor segments
  4. Extension polls for results, then automatically skips detected segments during playback
  5. A "Skipped ad" pill appears in the video player when a skip happens
  6. Click the extension icon to see all detected segments and jump to any of them

What it detects

  • Sponsor reads ("This episode is sponsored by...")
  • Affiliate promotions with discount codes
  • Cross-promotions for other podcasts/shows
  • Premium subscription and membership upsells
  • Merch store promotions
  • Pre-roll and mid-roll ad breaks

It does not flag editorial content, outro credits, guest thank-yous, or casual brand mentions.

Setup

Prerequisites

  • Node.js 18+
  • yt-dlp on PATH (brew install yt-dlp)
  • An OpenAI API key

Install

git clone https://github.com/masone/yt-ad-skip.git
cd yt-ad-skip
npm install

Create a .env file:

OPENAI_API_KEY=sk-...

Build & run

npm start                   # Start the server on :3001
npm run build               # Compile the extension to extension/dist/

Load the extension

  1. Open chrome://extensions
  2. Enable "Developer mode"
  3. Click "Load unpacked" and select the extension/ folder
  4. Navigate to any YouTube video — the extension handles the rest

Usage

  • Automatic skipping: Just watch YouTube. The extension detects videos, sends them for analysis, and skips ad segments as they come up.
  • Extension popup: Click the extension icon to see detected segments with timestamps and reasons. Click any segment to jump to its end.
  • "Skipped ad" pill: Appears in the top-right of the video player for 3 seconds when a segment is skipped.

Results are cached in out/<videoId>/ — delete a folder to re-process a video.

Scripts

Command Description
npm start Start the server
npm run build Build the extension
npm run typecheck Type-check everything
npm test Run unit tests
npm run eval Run eval suite

About

⏭️ Automagically skip in-video ads and sponsor segments in youtube videos with this nifty extension.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors