Created
January 26, 2023 20:56
-
-
Save fResult/2d6650dcc764cde85bad57b902b71389 to your computer and use it in GitHub Desktop.
This file contains 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
function cp(start = 0, end = 10) { | |
const spanParagraphs = document.querySelectorAll('[class^=transcript--underline-cue] > span') | |
const texts = Array.from(spanParagraphs) | |
.slice(start, end) | |
.map(mapInnerText) | |
.reduce(concat, []) | |
const result = texts.join(' ').replaceAll('. ', '.\n') | |
copy(result) // You can paste copied text in https://translate.google.com | |
function mapInnerText(p) { | |
return p.innerText | |
} | |
function concat(lines, line) { | |
return [...lines, line] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment