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 频道获取直播
基础教程推荐
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- WPF 模态进度窗口 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
