Last active
April 17, 2022 05:39
-
-
Save OzanKurt/00fd377638e45aca42297d314fbabf28 to your computer and use it in GitHub Desktop.
Clean Up your YouTube
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delete All Comments | |
// 1- https://myactivity.google.com/page?page=youtube_comments | |
// 2- Run the script | |
let delay = ms => new Promise(res => setTimeout(res, ms)); | |
let btns = document.querySelectorAll('.VfPpkd-Bz112c-LgbsSe.yHy1rc.eT1oJ') | |
for (let i = 0; i < btns.length; i++) { | |
console.log(i) | |
let btn = btns[i] | |
await delay(500) | |
btn.click() | |
} | |
// Delete All Subscriptions | |
// 1- https://www.youtube.com/feed/channels | |
// 2- Run the script | |
let delay = ms => new Promise(res => setTimeout(res, ms)); | |
let btns = document.querySelectorAll('[aria-label^="Unsubscribe from"]') | |
for (let i = 0; i < btns.length; i++) { | |
console.log(i) | |
let btn = btns[i] | |
await delay(500) | |
btn.click() | |
await delay(500) | |
document.querySelector('[aria-label="Unsubscribe"]').click() | |
} | |
// Delete All Likes | |
// 1- https://www.youtube.com/playlist?list=LL | |
// 2- Run the script | |
let delay = ms => new Promise(res => setTimeout(res, ms)); | |
let btns = document.querySelectorAll('[aria-label="Action menu"]') | |
for (let i = 102; i < btns.length; i++) { | |
console.log(i) | |
let btn = btns[i] | |
await delay(500) | |
btn.click() | |
await delay(500) | |
let items = document.querySelectorAll('ytd-menu-service-item-renderer.style-scope.ytd-menu-popup-renderer') | |
let index = items.length - 1 | |
items[index].click() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment