Skip to content

Instantly share code, notes, and snippets.

@Far-Se
Last active October 16, 2022 03:19
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Far-Se/8866400ea3f548278d16415378a4d38e to your computer and use it in GitHub Desktop.
Save Far-Se/8866400ea3f548278d16415378a4d38e to your computer and use it in GitHub Desktop.
Youtube delete all liked videos. Hover your mouse on the 3 dots then hit F4. If video is deleted, go with the mouse to the next one. Install AutoHotKey first.
//Open DevTools and paste this in Console.
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();
#MaxThreadsPerHotkey 2
F4::
Toggle := !Toggle
loop
{
If not Toggle
break
Send {Click}
Sleep 200
Send {Tab}
Send {Up}
Send {Enter}
Sleep 200
}
return
@Far-Se
Copy link
Author

Far-Se commented Nov 14, 2020

For [Deleted Video] or [Private Video] You need to open YT App and delete them from there.

There is a bug in YT Web for that kind of entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment