How to get automatically generated subtitles from youtube using javascript?

I use the following method to get the subtitles of a youtube video: SLwGbDkUe3s SLwGbDkUe3s

The bolded part is the ID of the video.

I designed a textbox using javascript where users can insert the url of a video and then, they get the subtitles. 

It works only if the uploader of the video submitted the subtitles to youtube. But if the subtitles are automatically generated, those links do not work.

I would like to get the automatically generated subtitles using javascript function or codes. Or I need to know how to get a link to the automatically generated subtitles of a video.  Any ideas?

Thank you so much,

1 Like