Get closed caption “cc” for Youtube video

后端 未结 4 459
借酒劲吻你
借酒劲吻你 2020-12-13 15:50

Does any one know how to get the CC for any Youtube video that has the caption available? I know on the API 2.0 documentation mentions that it is only available for the owne

相关标签:
4条回答
  • 2020-12-13 16:19

    Your first example should work without the name= part. This did the job for me:

    video.google.com/timedtext?lang={languageID}&v={videoId}
    

    To fetch the english CC version from the previous answer, it would look like this:

    http://video.google.com/timedtext?lang=en&v=zzfCVBSsvqA
    
    0 讨论(0)
  • 2020-12-13 16:20

    You can get the list of available captions with http://video.google.com/timedtext?type=list&v=zzfCVBSsvqA request.

    Your 3rd video has only automatically generated captions, which you cannot fetch easily.

    0 讨论(0)
  • 2020-12-13 16:25

    Here my suggestions after spending some time:

    • Js library: https://github.com/syzer/youtube-captions-scraper => support auto-generated caption.

    • 2 quick methods below not support auto-generated caption

      • Get a list of subtitles: http://video.google.com/timedtext?type=list&v=lT3vGaOLWqE
      • Get subtitle with track id: http://video.google.com/timedtext?type=track&v=lT3vGaOLWqE&id=0&lang=en
    • Quick download: http://downsub.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dag_EJRhMfOM

    0 讨论(0)
  • 2020-12-13 16:27

    If video.google.com does not fetch your closed caption file OR you don't want your file in XML format, but would rather SRT (see note below), try:

    CC SUBS

    NOTE: SRT can be transformed into virtually ANY format - either using free subtitling tools OR by replacing \n\n with |, \n with ; and then | into \n, you get a CSV file that can be opened in a spreadsheet, for example.

    0 讨论(0)
提交回复
热议问题