Getting YouTube auto-transcript from API?

ぐ巨炮叔叔 提交于 2020-01-13 03:48:26

问题


Is it possible to pull the auto (non-user) generated video transcripts from any of the YouTube APIs?


回答1:


You may refer with this thread: How to get "transcript" in youtube-api v3

If you're authenticating with oAuth2, you could do a quick call to this feed:

http://gdata.youtube.com/feeds/api/videos/[VIDEOID]/captiondata/[CAPTIONTRACKID]

to get the data you want. To retrieve a list of possible caption track IDs with v2 of the API, you access this feed:

https://gdata.youtube.com/feeds/api/videos/[VIDEOID]/captions

That feed request also accepts some optional parameters, including language, max-results, etc. For more details, along with a sample that shows the returned format of the caption track list, see the documentation at https://developers.google.com/youtube/2.0/developers_guide_protocol_captions#Retrieve_Caption_Set

Also, here are some references which migh help:

  • https://www.quora.com/Is-there-any-way-to-download-the-YouTube-transcripts-that-are-generated-automatically
  • http://ccm.net/faq/40644-how-to-get-the-transcript-of-a-youtube-video



回答2:


As of Aug 2019 the following method you to download transcripts:

  1. Open in Browser

https://www.youtube.com/watch?v=[Video ID]

  1. From Console type:
    JSON.parse(ytplayer.config.args.player_response).captions.playerCaptionsTracklistRenderer.captionTracks[0].baseUrl


来源:https://stackoverflow.com/questions/42867732/getting-youtube-auto-transcript-from-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!