Getting livestreams from YouTube channel(从 YouTube 频道获取直播)
问题描述
我正在尝试跟踪特定频道的直播观众.当我获得流 ID 并手动使用时,这没有问题.
I am trying to keep track of the livestream viewers of a specific channel. This is no problem when I have got the stream ID and use it manually.
但是我希望我的程序能够自动跟踪即将到来的直播.所以我想从频道中获取下一个即将到来的直播的直播 ID.我一直在查看 API 的文档,但找不到任何东西.
However I want my program to be able to track upcoming livestream automatically. So I want to get the livestream ID from the channel for the next upcoming livestream. I have been looking through the documentation from the API, but I couldn't find anything.
我需要调用什么 API?
What API call do I need to make?
推荐答案
您无法获取 liveBroadcast
或 liveStream
对象,该对象不属于您进行身份验证的用户或频道.每个对象的 list
端点要求您以自己的频道/用户身份进行身份验证,以仅检索您自己的实时事件.
You cannot get the liveBroadcast
or liveStream
object that does not belong to the user or channel you are authenticated as. The list
endpoint for each object requires your to authenticate as your own channel/user to retrieve your own live events only.
如果您想检索其他频道当前直播的信息,您必须使用标准 搜索/列表
端点:
If you want to retrieve information on another channel's current live broadcasts, you have to use the standard Search/list
endpoint:
部分->片段
channelId
-> [直播活动的频道/用户的channelId]
eventType ->直播
类型->视频
(将eventType
设置为live
时需要)
HTTP GET https://www.googleapis.com/youtube/v3/search?part=snippet&channelId={channelId}&eventType=live&type=video&key={YOUR_API_KEY}
这篇关于从 YouTube 频道获取直播的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 YouTube 频道获取直播
基础教程推荐
- SSE 浮点算术是否可重现? 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- rabbitmq 的 REST API 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 将 XML 转换为通用列表 2022-01-01