You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Access the link: https://www.youtube.com/feed/channels
Scroll to the bottom of the page to populate all items on the screen.
Press F12
Insert the code below in your console
vari=0;functionmyTimer(){vargridContainer=document.getElementById("grid-container");if(!gridContainer){console.error("Grid container not found.");return;}varels=gridContainer.getElementsByClassName("ytd-expanded-shelf-contents-renderer");if(i>=els.length){console.log("All possible channels have been processed.");return;// Stops the function when all elements are processed.}varunsubscribeButton=els[i].querySelector("[aria-label^='Unsubscribe from']");if(unsubscribeButton){unsubscribeButton.click();setTimeout(()=>{varconfirmButton=document.getElementById("confirm-button");if(confirmButton){if(confirmButton.children[0]&&confirmButton.children[0].children[0]){confirmButton.children[0].children[0].click();}else{console.error("Confirm button structure is not as expected.");}}else{console.error("Confirm button not found.");}},1000);console.log(i+1+" unsubscribed by Assem");i++;setTimeout(myTimer,3000);}else{console.error("Unsubscribe button not found for channel index "+i);i++;setTimeout(myTimer,1000);}}myTimer();
About
Automates unsubscribing from YouTube channels using a JavaScript script that clicks on unsubscribe buttons and confirms actions, streamlining subscription management.