Skip to content

Instantly share code, notes, and snippets.

@unrevised6419
Last active June 6, 2025 09:15
Show Gist options
  • Save unrevised6419/a3995cc9f8c4f0f566a4c3f208c74247 to your computer and use it in GitHub Desktop.
Save unrevised6419/a3995cc9f8c4f0f566a4c3f208c74247 to your computer and use it in GitHub Desktop.
youtube transcript
javascript: (() => {
/* First open YT Transcript Panel, then copy paste this snippet into the console */
let linesEl = [...document.querySelector('#segments-container').children];
let linesTextIrregular = linesEl.map(el => el.textContent.trim());
let linesText = linesTextIrregular.map(l => l.split('\n').map(s => s.trim()).filter(Boolean).join(' '));
let paragraph = linesText.join('\n');
navigator.clipboard.writeText(paragraph);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment