Is it possible to download the automatic captions from a video?
Asked Answered
D

3

20

My goal is to download automatic caption from a set of youtube videos. (I just want to get video information and subtitles of videos according to a query) The first thing I read is that you cannot download subtitles if you are not the owner. But I do not want the subtitles the owner uploaded, I just need the automatic ones.

For that I've seen some solutions, most of them with external applications . One of them is thorugh this URL: http://video.google.com/timedtext?type=track&v=3wszM2SA12E&name=Automatic&lang=en The problem are:

  1. that this is not the best way to access youtube data.
  2. It doesnt work with every video.

Does Youtube API offer a way to access this information?

Thank you in advance!!

Disembody answered 21/2, 2013 at 11:6 Comment(1)
This URL above no longer works. Not surprising since it is something from 10 years agoSlicker
S
30

You can download automatic captions for virtually any "public" or "unlisted" YouTube video so long as the owner of the video hasn't disabled embedding for the video by using one of two websites I have created:

  • Captions Grabber, an app intended to give you quick access to the automatic captions in a format that can be easily copied to the clipboard for use elsewhere, and
  • HyprScribr, an integrated online automatic captions cleanup tool.

DIY Captions, mentioned in an earlier version of this answer, is now basically a menu page that gives access to these two sites as well as to my "YouTube Transcription Pad." A fourth option opens the video in "oTranscribe" a transcription tool created by Elliott Bentley, that can be used for audio files and for YouTube videos.

Sundowner answered 18/9, 2013 at 6:43 Comment(4)
is there anyway to get the timing indications?Supplicant
diycaptions.com does not work - Select Action is brokenPropel
seemed to work as of today - downloaded auto-generated closed caption text in a variety of optionsSteinke
Update to my previous answer. DIYCaptions now points to two other websites that I have created. * www.captionsgrabber.com and * www.hyprscribr.com. Captions Grabber allows access to the text of a given YouTube video's automatic captions as well as access to human produced captions and translated subtitles. HyprScribr is an online editor that makes cleanup of automatic captions fast and easy. By using the menu in HyprScribr, one can obtain the text with the timing in .srt format.Sundowner
B
7

Yes it is (as of now). There is a tool called youtube-dl. It supports many options that one could check alone. Just as an example:

>youtube-dl https://www.youtube.com/watch?v=YOUR_VIDEO_HASH --write-auto-sub --sub-lang en

This will download the video along with the auto-generated subtitles in english.

Boccherini answered 19/8, 2021 at 13:9 Comment(1)
It doesn't work always, depends on the video.Humanize
C
4

In case you want to download just the auto-generated subtitles:

yt-dlp --write-auto-subs --skip-download 'Video_URL'

(yt-dlp seems to be better maintained than youtube-dl)

Crouton answered 15/12, 2023 at 23:40 Comment(3)
The '{Video_URL}' part doesn't work as it complains the video link is not a valid URL. Replacing '{}' with simply "" works as expected.Shame
It may also be worth mentioning that auto conversion will not happen when we are just downloading the subtitles, so the file that gets downloaded is in vtt format instead of srt. That said, it's quite easy to convert it manually using ffmpeg -i foo.vtt foo.srt or similar tools.Shame
@Shame If you have ffmpeg installed you can also add the option --convert-subs srt to the above command.Crouton

© 2022 - 2024 — McMap. All rights reserved.