如何获得“成绩单"在 youtube-api v3 中 [英] How to get "transcript" in youtube-api v3

查看:29
本文介绍了如何获得“成绩单"在 youtube-api v3 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始在 android 设备上使用 v3 版的 YouTube api,使用 java 客户端库.我感兴趣的一些视频有我可以在网络界面上访问的成绩单(如教育视频).有没有办法使用 v3 api 访问成绩单(如果有)?

I have started using v3 of the YouTube apis on an android device, using the java client library. Some videos that I am interested in have transcripts that I can access on the web interface (like educational videos). Is there a way to access the transcripts, if present, using the v3 apis?

谢谢

推荐答案

我可能错了,但我认为目前还没有通过 API 的 v3 获取字幕轨道的文档化方法.但是,如果您使用 oAuth2 进行身份验证,那么您的身份验证也适用于 API 的 v2,因此您可以快速调用此提要:

I may be wrong, but I don't think there is yet a documented way to get the caption track via v3 of the API. If you're authenticating with oAuth2, however, your authentication will also be good for v2 of the API, so you could do a quick call to this feed:

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

获取你想要的数据.要使用 API 的 v2 检索可能的字幕轨道 ID 列表,请访问此提要:

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

该提要请求还接受一些可选参数,包括语言、最大结果等.有关更多详细信息以及显示字幕轨道列表返回格式的示例,请参阅 https://developers.google.com/youtube/2.0/developers_guide_protocol_captions#Retrieve_Caption_Set

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

这篇关于如何获得“成绩单"在 youtube-api v3 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆