Created
October 2, 2025 15:21
-
-
Save segyges/74778bf0ca29a1172d396ac4d9004a05 to your computer and use it in GitHub Desktop.
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
| // Takes a youtube transcript and makes it one big string | |
| // Get all transcript segments | |
| const segments = document.querySelectorAll('ytd-transcript-segment-renderer'); | |
| // Extract text from each segment | |
| const text = Array.from(segments) | |
| .map(segment => segment.querySelector('.segment-text')?.textContent.trim()) | |
| .filter(text => text) // Remove any empty entries | |
| .join(' '); | |
| console.log(text); | |
| // Optionally copy to clipboard | |
| copy(text); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment