There used to be an option on Youtube to remove timestamps from the transcript, which I often used to copy it to the clipboard. No longer. Now my solution is to go into the Code Inspector, and set the class property to display:none. It works, but I'd like to automate it with a bookmarklet. This is as far as I've gone:
function() {
var trans = '';
const captions = document.querySelectorAll("ytd-transcript-segment-renderer > div > yt-formatted-string");
for (let i = 0; i < captions.length; i++) {
trans += ' ' + captions[i].textContent
};
navigator.clipboard.writeText(trans)
}
Help?