Created
September 28, 2020 21:21
-
-
Save dataserver/f14f8c7d3130a3885a1c5765921cd269 to your computer and use it in GitHub Desktop.
2020 September - Remove Youtube likes
This file contains 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
// SOURCE: https://webapps.stackexchange.com/questions/90238/delete-all-videos-on-my-liked-videos-youtube-automatic-playlist | |
// visit: https://www.youtube.com/playlist?list=LL | |
// open console, copy + paste | |
// obs: deleted videos just wont disappear from youtube... | |
// scroll down the list as much as possible because the default list size is just 100. | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
async function deleteLikedVideos() { | |
'use strict'; | |
var items = document.querySelectorAll('ytd-menu-renderer > yt-icon-button.dropdown-trigger > button[aria-label]'); | |
var out; | |
for (var i = 0; i < items.length; i++) { | |
items[i].click(); | |
out = setTimeout(function () { | |
if (document.querySelector('paper-listbox.style-scope.ytd-menu-popup-renderer').lastElementChild) { | |
document.querySelector('paper-listbox.style-scope.ytd-menu-popup-renderer').lastElementChild.click(); | |
} | |
}, 100); | |
await sleep(500); // sleep cause browser can not handle the process | |
clearTimeout(out); | |
} | |
} | |
deleteLikedVideos(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update