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

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

问题描述

我使用YT API来获取视频的说明。我可以使用旧的API使用API​​调用像这样获取视频的完整描述:<一href=\"http://gdata.youtube.com/feeds/api/videos?v=2&alt=json&callback=youtubeFeedCallback&q=football\"相对=nofollow> API调用

但使用新的API调用截断后160个字符的描述。例如:<一href=\"https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&key=API_KEY_HERE&part=snippet&fields=items%28snippet%28title,description,categoryId%29%29\" rel=\"nofollow\">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请求,因为他们获取不同类型的数据。基本上,用的搜索的请求(无论是旧的API V2在搜索饲料,你已经张贴,或新的V3 API,你没有张贴的例子在搜索端点)总会返回截断的描述。 A 视频的请求(其中有对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天全站免登陆