Last active
March 18, 2025 01:37
-
-
Save PythonCoderAS/8cd261d175785d5a3139f4464cae2b23 to your computer and use it in GitHub Desktop.
Auto publish all drafts on YouTube Studio (assuming you have defaults set so all you need to do is click the next/done buttons)
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
| const sleep = ms => new Promise(r => setTimeout(r, ms)); | |
| async function publishDraft() { | |
| document.querySelector('.edit-draft-button .yt-spec-touch-feedback-shape__fill').click(); | |
| do { await sleep(500); } while (!document.querySelector('#next-button .yt-spec-touch-feedback-shape__fill')) | |
| for (let i = 0; i < 3; i++) { | |
| document.querySelector('#next-button .yt-spec-touch-feedback-shape__fill').click(); | |
| await sleep(1000); | |
| } | |
| document.querySelector('#done-button .yt-spec-touch-feedback-shape__fill').click() | |
| await sleep(5000) | |
| document.querySelector('#close-button .yt-spec-touch-feedback-shape__fill').click() | |
| await sleep(1000) | |
| } | |
| const count = document.querySelectorAll('.edit-draft-button .yt-spec-touch-feedback-shape__fill').length; | |
| for (let i = 0; i < count; i++) await publishDraft(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment