I built a Chrome extension that drag-and-drops YouTube videos into playlists using AI
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
Drag-and-drop detection - Content script listens for
dragstarton video thumbnails. When a drop event hits the overlay, it extracts the video title and channel name from the DOM.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.
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.
Manifest V3 - Built on MV3 for future Chrome compatibility. Service worker handles auth token refresh.
The tricky parts
- OAuth flow in MV3 - The
chrome.identityAPI 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: trueon event listeners and callstopPropagation. - 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
No comments yet. Start the discussion.