Fetching latest headlines…
I built a Chrome extension that drag-and-drops YouTube videos into playlists using AI
NORTH AMERICA
πŸ‡ΊπŸ‡Έ United Statesβ€’July 6, 2026

I built a Chrome extension that drag-and-drops YouTube videos into playlists using AI

0 views0 likes0 comments
Originally published byDev.to

The problem

I have hundreds of saved YouTube videos scattered across playlists. Every time I find something worth saving, I have to: open the video, click "Save", scroll through a list of playlists, find the right one, click it. Repeat dozens of times a day.

I wanted something faster β€” ideally just drag and drop.

What I built

I built Tortma β€” a Chrome extension that puts a floating overlay on youtube.com. You drag any video thumbnail onto it, and the AI suggests which of your existing playlists it belongs to. You confirm with one click.

The whole thing takes under 2 seconds per video.

How it works technically

1. Drag-and-drop detection
Content script listens for dragstart on video thumbnails. When a drop event hits the overlay, it extracts the video title and channel name from the DOM.

2. YouTube Data API v3
The extension uses Google OAuth to fetch the user's actual playlists. This means AI suggestions are personalized β€” it knows your real playlist names and descriptions.

3. AI matching
The video metadata + playlist list gets sent to a backend endpoint. An LLM does semantic matching and returns the best playlist match with a confidence score.

4. Manifest V3
Built on MV3 for future Chrome compatibility. Service worker handles auth token refresh.

The tricky parts

  • OAuth flow in MV3 β€” The chrome.identity API behaves differently than in MV2. Had to handle token refresh carefully in the service worker.
  • Drag events on YouTube β€” YouTube's own drag handlers conflict. Had to use capture: true on event listeners and call stopPropagation.
  • AI accuracy β€” First version just used the playlist name. Adding the playlist description and recent video history improved match accuracy significantly.

Stack

  • Chrome Extension (MV3) β€” content script, service worker, popup
  • YouTube Data API v3
  • Google OAuth 2.0
  • Backend API for AI matching

Try it

It's live on the Chrome Web Store: https://chromewebstore.google.com/detail/fmjfpejhfgkehebmcjakjkkdhchdmpce

Free tier: 20 videos/day. Would love feedback on the UX or any edge cases you hit!

Comments (0)

Sign in to join the discussion

Be the first to comment!