Grab Transcript

This free button saves the transcript of any YouTube video as a text file you can drop into your favorite AI chat to make summaries, questions, vocabulary lists, and more.

Grab Transcript

Drag this button up to your bookmarks bar.

How to use it.

  1. Drag the blue button to your bookmarks bar. Don't see the bar? Press Ctrl+Shift+B (Windows or Chromebook) or Cmd+Shift+B (Mac).
  2. Open a YouTube video, click ...more under it, then click Show transcript.
  3. Click your Grab Transcript bookmark. A .txt file named after the video downloads right away.

Works on school and home computers. Nothing is installed. It's just a bookmark you click yourself, and the transcript goes straight to your own downloads folder.


Optional for your home computer: open the transcript automatically

This add-on opens the transcript panel the moment a video loads, so you can skip step 2. It's a nice extra for your personal computer. School computers usually keep add-ons like this turned off, and the Grab Transcript button above works great there on its own.

To install: add the free Tampermonkey extension to your browser, click its icon and choose Create a new script, paste in the code below (replacing what's there), and save.

// ==UserScript==
  // @name         Auto-Open YouTube Transcript
  // @namespace    https://www.theaiteacherlab.com/
  // @version      1.0
  // @description  Opens the transcript panel on YouTube videos so Grab Transcript is ready to click.
  // @match        https://www.youtube.com/watch*
  // @match        https://www.youtube.com/*
  // @run-at       document-idle
  // @grant        none
  // ==/UserScript==
  
  (function () {
    'use strict';
    
      var lastVideo = null;
      
        // Find a button that says "Show transcript" (by its label or its text).
          function findButton() {
              var buttons = document.querySelectorAll(
                    'ytd-video-description-transcript-section-renderer button, button[aria-label], button'
                        );
                            for (var i = 0; i < buttons.length; i++) {
                                  var b = buttons[i];
                                        var label = (b.getAttribute('aria-label') || b.textContent || '').trim();
                                              if (/^show transcript$/i.test(label)) return b;
                                                  }
                                                      return null;
                                                        }
                                                        
                                                          // Check every half second for up to 15 seconds, then click once per video.
                                                            function openTranscript() {
                                                                var id = new URLSearchParams(location.search).get('v');
                                                                    if (!id || id === lastVideo) return;
                                                                        lastVideo = id;
                                                                            var tries = 0;
                                                                                var timer = setInterval(function () {
                                                                                      var button = findButton();
                                                                                            if (button) {
                                                                                                    clearInterval(timer);
                                                                                                            button.click();
                                                                                                                  } else if (++tries > 30) {
                                                                                                                          clearInterval(timer);
                                                                                                                                }
                                                                                                                                    }, 500);
                                                                                                                                      }
                                                                                                                                      
                                                                                                                                        // YouTube changes pages without reloading (for example, clicking a video on
                                                                                                                                          // the home page), so this also runs on every YouTube page and waits for a video.
                                                                                                                                            window.addEventListener('yt-navigate-finish', openTranscript);
                                                                                                                                              openTranscript();
                                                                                                                                              })();

Comments

Popular Posts