Created
October 26, 2025 02:52
-
-
Save jongan69/d4a7357d00cbd2a280982baaa012485d to your computer and use it in GitHub Desktop.
A browser console log script for getting the transcript from a video
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
| (() => { | |
| // Select all transcript segments | |
| const segments = document.querySelectorAll('ytd-transcript-segment-renderer'); | |
| if (!segments.length) { | |
| console.error("❌ No transcript segments found. Make sure the transcript panel is open."); | |
| return; | |
| } | |
| // Extract only the text from each segment | |
| const transcript = Array.from(segments) | |
| .map(seg => seg.querySelector('.segment-text')?.innerText.replace(/\s+/g, ' ').trim() || '') | |
| .join(' '); | |
| // Output to console | |
| console.log("🎬 FULL VIDEO TRANSCRIPT (no timestamps):\n\n" + transcript); | |
| // Copy to clipboard | |
| navigator.clipboard.writeText(transcript) | |
| .then(() => console.log("✅ Transcript copied to clipboard!")) | |
| .catch(() => console.warn("⚠️ Could not copy to clipboard automatically.")); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment