How to Unsubscribe Youtube Subscriptions All @ once

 Using the Inspect Element


Now, onto the second method. This is a little technical, so you’re required to be precise with your steps. You can use the Inspect Element to automate the process and unsubscribe from all your YouTube channels in one go. Here’s what you need to do:


Open the subscribed channels list as you have done in the first method. Scroll your way down to the last channel to load all the channels on your screen. Now, right-click on the screen and select Inspect (or Inspect Element).


Then, click on the Console tab from the array of tabs on top. Copy and paste the following code on the bottom of the Console window and press Enter:

You will observe YouTube channels being unsubscribed one after the other.


Code: 1


/**

* YouTube bulk unsubscribe fn.

* Wrapping this in an IIFE for browser compatibility.

*/

(async function iife() {

// This is the time delay after which the "unsubscribe" button is "clicked"; Change it as per your need!

var UNSUBSCRIBE_DELAY_TIME = 2000

/**

* Delay runner. Wraps `setTimeout` so it can be `await`ed on.

* @param {Function} fn

* @param {number} delay

*/

var runAfterDelay = (fn, delay) => new Promise((resolve, reject) => {

setTimeout(() => {

fn()

resolve()

}, delay)

})

// Get the channel list; this can be considered a row in the page.

var channels = Array.from(document.getElementsByTagName(`ytd-channel-renderer`))

console.log(`${channels.length} channels found.`)

var ctr = 0

for (const channel of channels) {

// Get the subscribe button and trigger a "click"

channel.querySelector(`[aria-label^='Unsubscribe from']`).click()

await runAfterDelay(() => {

// Get the dialog container...

document.getElementsByTagName(`yt-confirm-dialog-renderer`)[0]

// and find the confirm button...

.querySelector(`[aria-label^='Unsubscribe']`).click()

console.log(`Unsubsribed ${ctr + 1}/${channels.length}`)

ctr++

}, UNSUBSCRIBE_DELAY_TIME)

}

})()


Code : 2

var i = 0;
var count = document.querySelectorAll(
"ytd-channel-renderer:not(.ytd-item-section-renderer)"
);
myTimer();
function myTimer() {
if (count == 0) return;
el = document.querySelector(".ytd-subscribe-button-renderer");
el.click();
setTimeout(function () {
var unSubBtn = document.getElementById("confirm-button").click();
i++;
count--;
console.log("channel " + i + " unsubscribed");
setTimeout(function () {
el = document.querySelector("ytd-channel-renderer");
el.parentNode.removeChild(el);
myTimer();
}, 250);
}, 250);
}



Comments

Popular Posts