Last active
March 22, 2026 18:57
-
-
Save sdawood/800d65aab10ba47370038d167fed520f to your computer and use it in GitHub Desktop.
How to remove (unlike) all liked videos on youtube, June, 2023
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
| /* | |
| * inspired by https://gist.github.com/astamicu/eb351ce10451f1a51b71a1287d36880f | |
| * modified to remove all liked Youtube videos and to work with Youtube as of June 2023 | |
| */ | |
| setInterval(function () { | |
| videos = document.getElementsByTagName('ytd-playlist-video-renderer'); | |
| // when a video is removed, the tag gets an 'is-dimissed' attribute, which tripped the original script | |
| var notDismissedIndex = 0; | |
| video = videos[notDismissedIndex]; | |
| while(video.hasAttribute('is-dismissed')) { | |
| notDismissedIndex++; | |
| video = videos[notDismissedIndex] | |
| } | |
| video.querySelector('#primary button[aria-label="Action menu"]').click(); | |
| var things = document.evaluate( | |
| '//yt-formatted-string[contains(text(),"Remove from")]', | |
| document, | |
| null, | |
| XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, | |
| null | |
| ); | |
| for (var i = 0; i < things.snapshotLength; i++) | |
| { | |
| things.snapshotItem(i).click(); | |
| } | |
| }, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment