Skip to content

Instantly share code, notes, and snippets.

@drewandersonnz
Created April 13, 2020 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewandersonnz/3e2b14ba3783fd2a61a74c4d486331e4 to your computer and use it in GitHub Desktop.
Save drewandersonnz/3e2b14ba3783fd2a61a74c4d486331e4 to your computer and use it in GitHub Desktop.
Remove youtube videos from playlist from logged in account
/*
Thanks to https://gist.github.com/timothyarmstrong/10501804
Finding the target in firefox:
Developer console (F12) -> object selector -> playlist delete button
Right-click -> Copy -> CSS Selector -> paste to document.querySelector()
To use:
copy
Developer console (F12)
Javascript console
type "allow pasting"
paste function, press enter to activate
To stop:
Reload page.
*/
(function() {
var i = window.setInterval(function() {
var closeButton = document.querySelector('ytd-playlist-panel-video-renderer.style-scope:nth-child(1) > div:nth-child(2) > ytd-menu-renderer:nth-child(1) > div:nth-child(1) > ytd-button-renderer:nth-child(1) > a:nth-child(1) > yt-icon-button:nth-child(1)');
if (closeButton) {
closeButton.click();
} else {
window.clearInterval(i);
}
}, 500);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment