Youtube API 的 v3 是否让您获得仅上传的活动提要 [英] Does v3 of the Youtube API let you get an Activity feed with only uploads

查看:27
本文介绍了Youtube API 的 v3 是否让您获得仅上传的活动提要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

调用活动源的默认值是所有类型.如果有一种方法可以按类型过滤,这样我就可以获得上传的提要,那就太棒了.这可能吗?

The default for a call to the activity feed is all types. It would be amazing if there was a way to filter by type so I could get a feed of just uploads. Is this possible?

https://www.googleapis.com/youtube/v3/activities?access_token=####&part=id,snippet,contentDetails&home=true&maxResults=50

推荐答案

如果您要查找上传内容,实际上应该调用 Channels 资源以获取上传播放列表,然后将 PlaylistItems 用于您的活动供稿.

If you're looking for uploads, you should actually make a call to the Channels resource to get the Uploads playlist, and then use PlaylistItems for your activity feed.

要获取 Google 频道的上传内容,请在此处拨打电话:

So to get the Google channel's uploads, make a call here:

https://www.googleapis.com/youtube/v3/channels?part=contentDetails&id=UCK8sQmJBp8GCxrOtXWBpyEA&key={YOUR_API_KEY}

您将在 json 响应中找到播放列表 ID (UUK8sQmJBp8GCxrOtXWBpyEA):

You will find the playlist id (UUK8sQmJBp8GCxrOtXWBpyEA) here in the json response:

items -> contentDetails -> relatedPlaylists -> 上传

items -> contentDetails -> relatedPlaylists -> uploads

然后调用 PlaylistItems 资源,并将UUK8sQmJBp8GCxrOtXWBpyEA"设置为 playlistId

Then make a call to the PlaylistItems resource with "UUK8sQmJBp8GCxrOtXWBpyEA" set as the playlistId

https://www.googleapis.com/youtube/v3/playlistItems?part=id%2Csnippet%2CcontentDetails&maxResults=50&playlistId=UUK8sQmJBp8GCxrOtXWBpyEA&key={YOUR_API_KEY}

这篇关于Youtube API 的 v3 是否让您获得仅上传的活动提要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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