How to mass unsubscribe youtube account easily

If you subscribe to YouTube accounts too much, you may be annoyed by too many notifications. and if you want to delete them you will be too tired to unsubscribe them one by one.

An easy way to do this is with the help of a chrome extension. here's a simple way to do it.





*** script updated at 21/06/21

Create A File Called manifest.json

This is just a metadata file in JSON format that contains properties like your extension’s name, description, version number and so on. Every extension needs to have a JSON-formatted manifest file.


**copy the code below and paste it in to your manifest.json file:

{

 "manifest_version": 2,

 "name": "Youtube Unsubcriber - FreeAngel",

 "description": "This extension will do mass unsubscribe for your account ",

 "version": "1.0",

"content_scripts": [

 {

 "matches": ["https://www.youtube.com/*"],

 "js": ["youtube.js"]

 }

 ]

}


 Create A File Called youtube.js

**copy the code below and paste it in to your youtube.js file:


/*


(c) FreeAngel - 2021


https://www.youtube.com/channel/UCqRqvw9n7Lrh79x3dRDOkDg


*/


const interval = 5000;

const wait_delay = 10;

const reload_after_unsub = 15;

cur_tick = 0;

buttons = null;

btn_idx = 0;

no_subs = false;

   

   var readyStateCheckInterval = setInterval(function() {

   if (document.readyState === "complete") {

    cur_tick += interval/1000;

DoJob();

console.log("timer ...");

   }

}, interval);


function DoJob(){


if(cur_tick < wait_delay ) { console.log("waiting delay (15s) : "+cur_tick); return; }


if(no_subs) { 

if (cur_tick >= 30) { console.log("reloading page ..."); window.location = "https://www.youtube.com/feed/channels"; }

return; 

}

var cur_url = window.location.href;

if(cur_url.indexOf("youtube.com/feed/channels") == -1){ return; }

if(!buttons){

console.log("Get all unsub buttons");

buttons = document.querySelectorAll('.ytd-subscribe-button-renderer');

console.log("Got Btn : "+buttons.length);

btn_idx = 0;

}


if (!buttons.length) {

console.log('There are no subscriptions on your channel.');

no_subs = true;

return;

}


if ((btn_idx >= buttons.length-1) || (btn_idx >= reload_after_unsub)){

window.location = "https://www.youtube.com/feed/channels";

return;

}


var found = false;

for(var i=0; i<buttons.length; i++){

  var al = buttons[i].getAttribute('aria-label');

  if((al) && (al.indexOf('Unsubscribe from') != -1)) {

  buttons[i].scrollIntoView();

  buttons[i].click();

  setTimeout(function() {

const button = document.getElementById('confirm-button');

if (button) { button.click(); }

}, 100);

  btn_idx++;

  found = true;

  break;

}

}

if(!found){

console.log('There are no subscriptions on your channel.');

no_subs = true;

}

}


put the two files in a directory, you can name the directory anything you want.

Or You can download it from here :

https://drive.google.com/file/d/1ky4SYMIbeYnqM-ooFLOTvuUkAWWB3kLn/view?usp=sharing

CONNECT TO CHROME

Now we need to ..load the extension!

*IMPORTANT: Make sure to click reload after every change you make so you can see it in action →

Post a Comment