Closed captions on YouTube as JSON

Is there a way to get closed captions in a youtube clip as json? I read that passing "alt = json" should work, but that doesn't seem to be the case. Any ideas? Does CC also work when done through translation? For example, curl " http://www.youtube.com/api/timedtext?v=V6Tsrg_EQMw&lang=en " returns nothing (although the clip has CC)

+4
source share
2 answers

There is currently no supported API for extracting hidden subtitle tracks for arbitrary videos. (You may be able to reconstruct some methods of obtaining this data, but this is not supported, and I cannot encourage it.)

The officially supported header methods for the v2 YouTube Data API are documented at https://developers.google.com/youtube/2.0/developers_guide_protocol_captions

Only an authenticated request that owns this video will display a list of subtitle tracks and allow you to download them in .srt or .sub format (not JSON).

I would expect that at some point there will be methods for interacting with headers in the v3 API, but unfortunately I do not have any specific information to share what might happen.

+4
source
  1. Use youtube-dl to download signatures (like srt , ass , vtt or lrc ).
  2. Use the TranscribeFiles Title and Subtitle Converter to convert to any of 11 different json schemes.
0
source

Source: https://habr.com/ru/post/1479988/


All Articles