Skip to content

Instantly share code, notes, and snippets.

@PythonCoderAS
Last active March 18, 2025 01:37
Show Gist options
  • Select an option

  • Save PythonCoderAS/8cd261d175785d5a3139f4464cae2b23 to your computer and use it in GitHub Desktop.

Select an option

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)
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