Reputation: 142939
Until today I was using this URL to get captions from YouTube videos:
https://video.google.com/timedtext?lang=${lang}&v=${id}
For example https://video.google.com/timedtext?lang=zh&v=rIZNQwCfeig
.
This was always working before, but as of today it started returning a blank response.
Did the API change recently? Is there a new way to get captions from YouTube videos?
Upvotes: 3
Views: 926
Reputation: 54409
Unfortunately, there are no signs that this API will get back to life.
I ended up using youtube-dl
instead:
youtube-dl --write-sub --sub-lang $LANG_CODE --skip-download --sub-format ttml \
https://www.youtube.com/watch?v=$YOUTUBE_ID
This will save captions in ttml
format to a file, you'll need to read its content and delete that file manually. It is a bit more complicated than before, but still much easier than using the official YouTube Captions API.
Upvotes: 2