gpt4 book ai didi

youtube - lang参数在Youtube API中不起作用

转载 作者:行者123 更新时间:2023-12-03 05:33:31 26 4
gpt4 key购买 nike

我的任务是获取带有确定语言的字幕的视频
根据查询参数documentation我使用:

caption = true - subtitles filter
lr = en - original video language
hl = en - the primary language of the movies
lang = de - the language I want to get the subtitles



查询示例:
https://gdata.youtube.com/feeds/api/videos?safeSearch=strict&strict=true&v=2&caption=true&key=XXX&q=football&hl=en&lr=en&lang=de

结果:
<errors xmlns='http://schemas.google.com/g/2005'>
<error>
<domain>GData</domain>
<code>unsupportedQueryParam</code>
<internalReason>Invalid query parameters:lang</internalReason>
</error>
</errors>

您能解释一下这个结果的原因吗?

最佳答案

我也迷失在youtube API中,但这是我的理解。

在您提供的链接中,参数lang描述为:

YouTube supports this parameter for requests to retrieve a caption track.



“问题”(对于大多数开发者而言,至少是个问题),如果您不是上传者,则无法请求视频字幕。
参见 here

Captions for a video can only be created, retrieved, modified and deleted by the owner of that video. To perform these operations for a video, you must submit authenticated API requests for which the video's owner is the logged-in user. Accordingly, API requests for caption operations must contain a properly formatted Authorization header.



这就是为什么我认为您不应该做自己想做的事情。

关于youtube - lang参数在Youtube API中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13117296/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com