Last active
October 16, 2022 03:19
-
-
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.
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
//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(); |
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
#MaxThreadsPerHotkey 2 | |
F4:: | |
Toggle := !Toggle | |
loop | |
{ | |
If not Toggle | |
break | |
Send {Click} | |
Sleep 200 | |
Send {Tab} | |
Send {Up} | |
Send {Enter} | |
Sleep 200 | |
} | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.