从 YouTube 频道获取直播
Getting livestreams from YouTube channel
我正在尝试跟踪特定频道的直播观众。
当我得到流 ID 并手动使用它时,这没问题。
但是我希望我的程序能够自动跟踪即将到来的直播。所以我想从频道获取下一次直播的直播 ID。我一直在查看 API 的文档,但找不到任何内容。
我需要拨打什么 API 电话?
您无法获取不属于您所认证的用户或频道的 liveBroadcast
or liveStream
对象。每个对象的 list
端点需要您验证为您自己的 channel/user 才能仅检索您自己的实时事件。
如果您想检索有关另一个频道当前直播的信息,您必须使用标准 Search/list
端点:
part -> snippet
channelId
-> [channelId of the channel/user with the live event]
eventType -> live
type -> video
(设置eventType
为live
时需要)
HTTP GET https://www.googleapis.com/youtube/v3/search?part=snippet&channelId={channelId}&eventType=live&type=video&key={YOUR_API_KEY}
我正在尝试跟踪特定频道的直播观众。 当我得到流 ID 并手动使用它时,这没问题。
但是我希望我的程序能够自动跟踪即将到来的直播。所以我想从频道获取下一次直播的直播 ID。我一直在查看 API 的文档,但找不到任何内容。
我需要拨打什么 API 电话?
您无法获取不属于您所认证的用户或频道的 liveBroadcast
or liveStream
对象。每个对象的 list
端点需要您验证为您自己的 channel/user 才能仅检索您自己的实时事件。
如果您想检索有关另一个频道当前直播的信息,您必须使用标准 Search/list
端点:
part -> snippet
channelId
-> [channelId of the channel/user with the live event]
eventType -> live
type -> video
(设置eventType
为live
时需要)
HTTP GET https://www.googleapis.com/youtube/v3/search?part=snippet&channelId={channelId}&eventType=live&type=video&key={YOUR_API_KEY}