通过谷歌驱动器sdk添加标题 [英] Adding the captions via the google drive sdk

查看:154
本文介绍了通过谷歌驱动器sdk添加标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有1k +隐藏式字幕(采用srt格式),我想将它们全部添加到Google云端硬盘上的视频中。是否可以通过API来完成?



谢谢
Radek

解决方案

是的,您可以通过 Drive REST API 。请参阅上传文件。您有三种选择:简单上传,分段上传和可恢复上传。


简单上传



上传文件最直接的方法是制作简单的上传请求。在以下情况下,此选项是一个不错的选择:




  • 如果连接失败,该文件足够小以重新上传。 / p>


  • 没有要发送的元数据。如果您打算在单独的请求中发送此资源的元数据,或者没有元数据支持或可用,则可能是这样。




分段上传



如果您想要随要上传的数据一起发送元数据,则可以制作单个多部分/相关请求。如果您发送的数据足够小,如果连接失败,则可以重新上传。



可恢复的上传



要更可靠地上载数据文件,您可以使用可恢复的上传协议。该协议允许您在通信故障中断数据流后恢复上传操作。如果您传输的是大文件,并且网络中断或某些其他传输失败的可能性很高,例如从移动客户端应用上传时,此功能尤其有用。它还可以减少网络故障时的带宽使用率,因为您不必从头开始重新启动大型文件上传。


您可能还想查看使用文件夹在文件夹中插入文件。

I have 1k+ closed captions (in the srt format) and I would like to add all of them to my videos on the google drive. Is it possible to do it via the API?

thank you Radek

解决方案

Yes, it is possible through Drive REST API. See Upload Files. You have three choices for this, Simple upload, Multipart upload and Resumable upload.

Simple upload

The most straightforward method for uploading a file is by making a simple upload request. This option is a good choice when:

  • The file is small enough to upload again in its entirety if the connection fails.

  • There is no metadata to send. This might be true if you plan to send metadata for this resource in a separate request, or if no metadata is supported or available.

Multipart upload

If you have metadata that you want to send along with the data to upload, you can make a single multipart/related request. This is a good choice if the data you are sending is small enough to upload again in its entirety if the connection fails.

Resumable upload

To upload data files more reliably, you can use the resumable upload protocol. This protocol allows you to resume an upload operation after a communication failure has interrupted the flow of data. It is especially useful if you are transferring large files and the likelihood of a network interruption or some other transmission failure is high, for example, when uploading from a mobile client app. It can also reduce your bandwidth usage in the event of network failures because you don't have to restart large file uploads from the beginning.

You may also want to see Work with Folders for inserting files in a folder.

这篇关于通过谷歌驱动器sdk添加标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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