Created
August 26, 2024 04:09
-
-
Save Hans5958/d870a3969beb6f4abcbfe3ce42c5f55f to your computer and use it in GitHub Desktop.
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
allVideos = [...document.querySelectorAll('ytd-playlist-video-renderer')] | |
videosToRemove = allVideos.filter(current => { | |
const videoLink = current.querySelector("#video-title").href.split("&")[0].split("?")[1] | |
const foundElements = allVideos.filter(el => el.querySelector(`a[href*="${videoLink}"]`)) | |
return foundElements[1] === current | |
}) | |
console.log(videosToRemove.length) | |
;(async () => { | |
for (const el of videosToRemove) { | |
el.querySelector('yt-icon-button').click() | |
await new Promise(r => setTimeout(r, 1000)); | |
document.querySelector('ytd-menu-service-item-renderer:has(path[d*="17H9V8h2v9zm4"])').click() | |
await new Promise(r => setTimeout(r, 1000)); | |
}})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment