Created
May 8, 2025 19:48
-
-
Save ethaniel/e97cabec05f4f879e8a660e24aa0d389 to your computer and use it in GitHub Desktop.
Remove deleted videos from Youtube playlists.
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
/* | |
Step 1. Go to Youtube Studio. | |
Step 2. Open your playlist (URL looks like: https://studio.youtube.com/playlist/ID/videos) | |
Step 3. Run the following command in your chrome console. | |
*/ | |
async function clickAllRemoveButtons(delay = 1000) { | |
let buttons; | |
do { | |
buttons = Array.from(document.getElementsByClassName("remove-from-playlist-button")); | |
for (const button of buttons) { | |
button.click(); | |
await new Promise(resolve => setTimeout(resolve, delay)); // Delay between clicks | |
} | |
// Wait a moment for new buttons to load | |
await new Promise(resolve => setTimeout(resolve, 500)); | |
} while (buttons.length > 0); | |
} | |
clickAllRemoveButtons(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment