YouTube unsubscribe

// ==UserScript==

// @name YouTube Mass Unsubscribe

// @namespace http://tampermonkey.net/

// @version 1.0

// @description Unsubscribe from all channels on YouTube

// @author You

// @match https://www.youtube.com/feed/channels

// @grant none

// ==/UserScript==

(function() {

‘use strict’;

let interval = setInterval(() => {

let buttons = document.querySelectorAll(‘ytd-subscribe-button-renderer tp-yt-paper-button[subscribed]’);

if (buttons.length === 0) {

console.log(“No more channels to unsubscribe.”);

clearInterval(interval);

return;

}

buttons[0].click();

setTimeout(() => {

let confirm = document.querySelector(‘yt-confirm-dialog-renderer #confirm-button tp-yt-paper-button’);

if (confirm) confirm.click();

}, 500);

}, 2000);

})();

Leave a comment