使用Google Drive API而不是共享URL的FFMPEG [英] FFMPEG using Google Drive API instead of Shared URL

查看:95
本文介绍了使用Google Drive API而不是共享URL的FFMPEG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用FFMPEG将Google云端硬盘URL流式传输到节点应用程序中.

是否有一个FFMPEG方法或库,我们可以使用

解决方案

从您的问题开始,我了解到您的文件是公开共享的.在这种情况下,文件大小变大时,需要分两个步骤处理 https://drive.google.com/uc?export=download&id=fileId 的终结点.参考在您的问题中也已经提及.

在这个答案中,为了避免这种情况,我想建议使用"Files:get"方法.在Drive API和API密钥中.将Drive API和API密钥用于公共共享文件时,不需要两步流程,并且只需更改URL就可以使用它.

端点:

  https://www.googleapis.com/drive/v3/files/{fileId}?alt = media& key = {您的API密钥} 

  • 例如,作为测试,使用curl命令时,可以使用 curl" https://www.googleapis.com/drive/v3/files/{fileId}?alt=media&key= {您的API密钥}" .

参考文献:

We are using FFMPEG to stream a Google Drive URL into a node application.

Is there an FFMPEG method or library we can use to stream to FFMPEG using the Google Drive API instead of using the standard public shared URL?

At the moment using the URL works fine if the file size is <100mb but with bigger files we get an error:

https://drive.google.com/uc?export=download&id=fileId: Invalid data found when processing input

This is because we reach the pesky gDrive virus roadblock page:

解决方案

From your question, I understood that your file is publicly shared. In this case, when the file size becomes large, the endpoint of https://drive.google.com/uc?export=download&id=fileId is required to be processed with 2 steps. Ref This has already been also mentioned in your question.

In this answer, in order to avoid this, I would like to propose to use the method of "Files: get" in Drive API and the API key. When Drive API and API key is used for the publicly shared file, no 2 step flow is required, and it can use it by changing only the URL.

Endpoint:

https://www.googleapis.com/drive/v3/files/{fileId}?alt=media&key={your API key}

  • For example, as a test, when you use curl command, you can use curl "https://www.googleapis.com/drive/v3/files/{fileId}?alt=media&key={your API key}".

References:

这篇关于使用Google Drive API而不是共享URL的FFMPEG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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