使用 YouTube API v3 获取完整的视频描述 [英] Getting complete description of video using YouTube API v3

查看:35
本文介绍了使用 YouTube API v3 获取完整的视频描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 YT API 来获取视频描述.我可以使用旧的 API 来获取完整的视频描述,使用 api 调用如下:API 调用
但是使用较新的 API 调用会在 160 个字符后截断描述.示例:https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&key=API_KEY_HERE&part=snippet&fields=items(snippet(title,description,categoryId))

I am using YT API to fetch video description. I can use older API to fetch complete description of video using api call like this: API CALL
But using the newer API call truncates the description after 160 characters. example: https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&key=API_KEY_HERE&part=snippet&fields=items(snippet(title,description,categoryId))

关于如何从 googleapis 而不是 gdata.youtube(它被截断)获取视频的完整描述的任何想法.

Any idea about how I can get full description of a video from googleapis and not gdata.youtube(it is truncated).

推荐答案

我认为您对您发布的请求 URL 有点混淆,因为它们正在检索不同类型的数据.基本上,对于 search 请求(无论是您发布的旧 V2 API 中的搜索提要,还是您未发布示例的新 V3 API 中的搜索端点)将始终返回截断的描述.videos 请求(您有 V3 的示例,但没有 V2 的示例)将返回完整的视频说明.这适用于 v2 或 v3.

I think you've confused things a bit with the request URLs you posted, as they are retrieving different types of data. Basically, with a search request (whether the search feed in the old V2 API that you've posted, or the search endpoint in the new V3 API which you didn't post an example of) will always return truncated descriptions. A videos request (which you have an example of for V3 but not for V2) will return the full video description. This is true for v2 or v3.

这篇关于使用 YouTube API v3 获取完整的视频描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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