如何使用Youtube API将字幕添加到Youtube视频? [英] How to add Subtitles to Youtube video using Youtube API?

查看:296
本文介绍了如何使用Youtube API将字幕添加到Youtube视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 Google Youtube API v3 添加字幕 Youtube 视频(重要条件 - 视频不是所有者)?

Is it possible to add subtitles to Youtube video using Google Youtube API v3 (important condition - for video's not owner)?

任务:使用 Google API Client Library for JavaScript添加所选语言的自定义字幕

Google maps API 允许添加,自定义标记(例如)到他们的地图,当我们谈论 Youtube API 字幕的解决方案c $ c>?)

(Google maps API allows add, custom Markers (for example) to their maps, maybe there is a solution for subtitles when we're talking about Youtube API?)

推荐答案

Google称他们为字幕,API部分名为 YouTube API v2.0 - 字幕

Google are calling them "captions" and API section is called YouTube API v2.0 – Captions.


请注意执行与标题相关的
API操作的以下要求:

Please note the following requirements for executing caption-related API operations:


  • 标题仅适用于API版本2。

  • 视频的字幕只能由该视频的所有者创建,检索,修改和删除。要为
    视频执行这些操作,您必须提交经过身份验证的API请求,其中
    视频的所有者是登录用户。因此,对
    字幕操作的API请求必须包含格式正确的授权
    标头。

  • 创建(POST),更新(PUT)或删除(DELETE)的请求字幕必须使用X-GData-Key
    请求标头或密钥请求参数来标识您的开发人员密钥。

这意味着您可以使用API​​添加字幕,但您需要拥有该视频的所有者权限。这是严格的政策,因此您不会在任何视频上显示错误字幕,例如,在视频中显示的内容与实际内容不同。

That means, that you can add captions with API, but you need to have owner access to that video. It is strict policy, so that you won't show "wrong" captions on any video, for example, that show different translation of content in video, than there actually is.

你只能通过将视频放在容器中,并将自己的文本叠加在视频上来模拟字幕来解决这个问题。

You can only hack around this, by putting video inside container, and overlay your own text over video thus simulating captions.

这篇关于如何使用Youtube API将字幕添加到Youtube视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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