Skip to content

Instantly share code, notes, and snippets.

@bensig
Last active July 14, 2021 02:30
Show Gist options
  • Save bensig/0d2ec0671141ef1afc9615c8cb398e42 to your computer and use it in GitHub Desktop.
Save bensig/0d2ec0671141ef1afc9615c8cb398e42 to your computer and use it in GitHub Desktop.
How to Transcribe Any YouTube Video

How to Transcribe Any YouTube Quickly and for Free

Requirements - Mac or Linux and you must have jq installed

On Mac install these via terminal:

  • brew with /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • jq with brew install jq

Getting the transcription of the audio from YouTube:

  1. Open the video in Chrome or Brave - start playing
  2. Right click the background and choose "Inspect"
  3. In the console, go to the network tab and choose "Network"
  4. Type in the search box "timedtext"
  5. Press the CC button the video
  6. Copy the URL that appears in the Network section
  7. Paste that url into a new browser window
  8. Copy all of the text into a file called transcript.json
  9. Run cat transcript.json| jq '.events[] | .segs' | grep utf8 | awk -F'"' '{print $4}' | | tr '\n' ' ' > transcript.txt
  10. Now you have a text file with all of the text that you can easily format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment