Open AjayRajNelapudi opened 4 years ago
Could not replicate issue at my end. Added logging into the code to help debug the issue further.
Invoking unsubscribeAll()
VM78:3 Finding all unsubscribe buttons...
VM78:5 Subscriptions: NodeList(100) [paper-button.style-scope.ytd-subscribe-button-renderer, . . . ] length: 100proto: NodeList
VM78:9 Selected channel: Akaash Singh Comedy
VM78:10 Clicking on unsubscribe button...
VM78:12 Finding confirm unsubscribe button...
VM78:14 Clicking on confirm unsibscribe button...
VM78:15 Uncaught TypeError: Cannot read property 'click' of null
at
Successfully replicated the issue on Google Chrome running on Windows 10. I could observe that the confirm unsubscription prompt is not handled by the code.
Working on fixing it.
Chrome doesn't respond after clicking on confirm unsubscribe prompt. The prompt stays open although the action is completed.
Was able to click all buttons, chrome ended up with HTTP 500 error. Cosnole Log: Invoking unsubscribeAll() VM397:2 Finding all unsubscribe buttons... VM397:4 Subscriptions: NodeList(7) [paper-button.style-scope.ytd-subscribe-button-renderer, paper-button.style-scope.ytd-subscribe-button-renderer, paper-button.style-scope.ytd-subscribe-button-renderer, paper-button.style-scope.ytd-subscribe-button-renderer, paper-button.style-scope.ytd-subscribe-button-renderer, paper-button.style-scope.ytd-subscribe-button-renderer, paper-button.style-scope.ytd-subscribe-button-renderer] VM397:8 Selected channel: Cambria Joy VM397:9 Clicking on unsubscribe button... VM397:11 Finding confirm unsubscribe button... VM397:8 Selected channel: CBC News: The National VM397:9 Clicking on unsubscribe button... VM397:11 Finding confirm unsubscribe button... VM397:8 Selected channel: David Pakman Show VM397:9 Clicking on unsubscribe button... VM397:11 Finding confirm unsubscribe button... VM397:8 Selected channel: Jesse VM397:9 Clicking on unsubscribe button... VM397:11 Finding confirm unsubscribe button... VM397:8 Selected channel: Music VM397:9 Clicking on unsubscribe button... VM397:11 Finding confirm unsubscribe button... VM397:8 Selected channel: Popular on YouTube VM397:9 Clicking on unsubscribe button... VM397:11 Finding confirm unsubscribe button... VM397:8 Selected channel: Sports VM397:9 Clicking on unsubscribe button... VM397:11 Finding confirm unsubscribe button... VM397:21 Exited unsubscribeAll() undefined 6 desktop_polymer_force_promise_polyfill.js:20559 POST https://www.youtube.com/youtubei/v1/subscription/unsubscribe?key=removed_key_for_security_reasons 500
Temporary fix: Use Firefox
VM99:11 Uncaught TypeError: Cannot read property 'click' of null at:11:21
at NodeList.forEach ()
at unsubscribeFromAllChannels (:5:16)
at :15:1
I'm currently aware of this exception observed when running this script from Chrome, logged into a YouTube account with around 300 subscribed channels.
This could possibly happen if
document.querySelectorAll('paper-button[aria-label="Unsubscribe"]')
was called before the confirm unsubscribe was prompted.Currently testing script on Chrome browser.