You can also get a YouTube video transcript directly from the API with one call, just register for a free developer key and use:
https://youtube.googleapis.com/youtube/v3/captions?part=snip...
official docs: https://developers.google.com/youtube/v3/docs/captions