Settings

Theme

Show HN: You Can Just Filter YouTube Playlists in the 'Save to Playlist' Dialog

3 points by ydoc5212 · 2 comments · 2 min read


Hi HN, I'm Cody, I have 847 YouTube playlists, and always hated that YouTube failed to provide basic playlist management tools. Ctrl+F was never convenient and breaks past 200 playlists. So I built & shipped my first Chrome extension. It replaces the Save dialog with a native-feeling searchable one that fetches all your playlists (and whether the current video is saved there) directly from YouTube's InnerTube API. It works robustly across every current save surface (watch page, home feed, search results, Shorts via right-click or Alt+S).

This version is faster and more stable than my original attempt. In 1.0 I read and wrote YouTube's DOM directly. It felt like the efficient approach, but makes for constant UI regressions as YouTube changes, so I can't recommend it. In 2.0 the UI lives outside YouTube's app tree in a closed shadow root, and the data comes from YouTube's internal InnerTube JSON API. The trigger it uses is a small hook wrapping the page's fetch, i.e. when YouTube's client requests the add-to-playlist panel.

Privacy: As private as possible given it's a YouTube extension. The extension only talks to youtube.com, doesn't ship any third-party code, and stores nothing about your playlists, just two display preferences: sort order, and the privacy new playlists are created with. AGPL-3.0.

Install: https://chromewebstore.google.com/detail/efgbkmnooapcpdpgmih... Source: https://github.com/codyhxyz/playlist-search-extension Site: https://playlist.codyh.xyz/

Bonus: Technically you can replicate the filter-bar functionality with a dev console script, which I've linked here: (https://gist.github.com/codyhxyz/00001e74d238ae5911ccfc8f8d4...). For obvious reasons, I prefer a dedicated extension.

Happy to answer anything about my approach including the InnerTube API or about the shadow-root. Always looking to improve the extension's architecture.

1 thread
kratis1986

This looks really cool - def gonna try it out! I've always wondered if there could be a way for YT Music to play "new" songs across my playlists, and was wondering the InnerTube API would allow me to build something like that?

  • ydoc5212OP

    I appreciate your comment, please let me know any feedback if you end up checking it out.

    As for YT Music, depends what you mean by "new", but probably yes. YT Music runs on the same InnerTube API, so you can read every playlist and your listening history and write a playlist back.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection