无法在Youtube API v3中下载隐藏式字幕 [英] Unable to download closed captions in Youtube API v3

查看:135
本文介绍了无法在Youtube API v3中下载隐藏式字幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Youtube API v3中提供的PHP示例代码: https://developers.google.com/youtube/v3/docs/captions/download ,以便从我的网络应用中的第三方公开的YouTube视频下载字幕,即我尚未将内容上传到YouTube.

Im using the PHP example code given in Youtube API v3 : https://developers.google.com/youtube/v3/docs/captions/download , to download captions from 3rd party, publicly available YouTube videos in my webapp i.e. I have NOT uploaded the content on Youtube.

我能够访问字幕轨道的列表,但是无法使用接收到的列表中的字幕轨道ID 下载字幕.

I am able to get access to the list of caption tracks, but unable to download the caption using the caption track ID from the received list.

尝试下载时显示的错误是:

The error that shows up upon attempting to DOWNLOAD is:

调用GET https://时出错 www.googleapis.com/youtube/v3/captions/Lw0e5xDNU17GFafOl8DcyeOtwzWJTf9V?tfmt=srt&alt=media: (404)找不到

Error calling GET https:// www.googleapis.com/youtube/v3/captions/Lw0e5xDNU17GFafOl8DcyeOtwzWJTf9V?tfmt=srt&alt=media: (404) Not Found

(我曾尝试删除tfmt(可选参数),但仍然出现错误.)

(I have tried removing tfmt (optional parameter), but still gives an error.)

但是尝试删除字幕的错误有所不同:

But the error is different for attempting to DELETE captions:

调用DELETE https://时出错 www.googleapis.com/youtube/v3/captions?id=Lw0e5xDNU17GFafOl8DcyeOtwzWJTf9V: (403)禁止

Error calling DELETE https:// www.googleapis.com/youtube/v3/captions?id=Lw0e5xDNU17GFafOl8DcyeOtwzWJTf9V: (403) Forbidden

因此,似乎除所有者以外的其他用户均不禁止使用captions.download(就像不禁止captions.list一样),因此我想将此数据用于我的Web应用程序.

Therefore it seems that captions.download is NOT forbidden for users other than owner (just like the captions.list is NOT forbidden) and therefore I would like to use this data for my webapp.

非常感谢您的帮助.

谢谢

尼基尔

推荐答案

我发现了另一种访问任何YouTube视频字幕数据的方法. 该代码是用Ruby编写的.

I have found another way to access any YouTube video's caption data. The code is written in Ruby.

从任何YouTube公开视频中读取YouTube字幕(字幕)

很好,我只需要找到一种方法将其与我的web应用程序集成.

Works great, I just need to find a way to integrate this with my webapp.

这篇关于无法在Youtube API v3中下载隐藏式字幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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