Skip to content

Instantly share code, notes, and snippets.

@liddiard
Created March 20, 2020 00:58
Show Gist options
  • Save liddiard/bc0a86baa89bc6c84201d58ab380e344 to your computer and use it in GitHub Desktop.
Save liddiard/bc0a86baa89bc6c84201d58ab380e344 to your computer and use it in GitHub Desktop.
Extract subtitles from a YouTube video API response (https://www.youtube.com/api/timedtext)
const subtitles = {} // replace with subtitles content
subtitles.events.map(ev => ev.segs[0].utf8.replace('\n', ' ')).join(' ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment