Last active
February 13, 2024 07:33
-
-
Save SrJSDev/6dd238a99c03ef469df0070654444e0d to your computer and use it in GitHub Desktop.
YouTube Transcript copy to clipboard bookmarklet (JavaScript)
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
javascript:void function(){document.querySelector("%23expand").click(),document.querySelector("button[aria-label=\"Show transcript\"]").click(),setTimeout(()=>{var a=document.querySelector("#content #body.ytd-transcript-search-panel-renderer").innerText;navigator.clipboard.writeText(a).then(()=>{alert("Transcript copied to clipboard")})},2e3)}(); |
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
document.querySelector('#expand').click(); | |
document.querySelector('button[aria-label="Show transcript"]').click(); | |
setTimeout(async () => { | |
var text = document.querySelector('#content #body.ytd-transcript-search-panel-renderer').innerText; | |
await navigator.clipboard.writeText(text).then( | |
() => { alert("Transcript copied to clipboard"); } | |
); | |
}, 2000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment