If you want to unsubscribe all YouTube channels for some reason.

Here is what you need to do:

  • Open your browser of choice (Chrome/Firefox)
  • Go to this URL: https://www.youtube.com/feed/channels
  • Open Inspect Element on your browser: Ctrl+Shift+I or Right-click on the screen & Select Inspect
  • Then, Click on the Console tab and now Copy & Paste the one of following script below and hit Enter

Script-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)
  }
})()

Source: How to unsubscribe from all your YouTube channels at once

Script-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)
}

Source: https://levelup.gitconnected.com/how-to-unsubscribe-from-all-youtube-channels-at-once-d516b3669325