如何识别视频是否为首映?...通过 YouTube API [英] How to identify if a video is a Premiere? ...via the YouTube API
问题描述
在 YouTube 上,我们上传了录制的视频、直播,现在还有首映.
On YouTube we have uploads of recorded videos, live streams, and now also Premieres.
使用视频:YouTube 数据 API 的列表端点我们可以通过使用 liveStreamingDetails
部分调用端点来区分录制的视频和直播流.如果提供详细信息,则它是实时流.如果不是,则是定期上传录制的视频.
Using the Videos: list endpoint of the YouTube Data API we can distinguish recorded videos from live streams by calling the endpoint with the liveStreamingDetails
part. If details are given then it is a live stream. If not then it is a regular upload of a recorded video.
这种方法无法帮助我识别首映.它们看起来好像是直播.至少对于上面的端点,我看不到直播和首映之间的区别.
This approach doesn’t help me with identifying Premieres. They appear as if they were live streams. At least with the endpoint above I see no difference between live streams and Premieres.
有什么方法可以检查视频是否真的是首映?我有视频 ID,并希望通过调用任何 YouTube 的 API 来实现此目的.
Is there any way to check if a video is in fact a Premiere? I have the video id and want to achieve this by calling any of YouTube’s APIs.
推荐答案
Edit:我实现这个的方式,我寻找 snippet.liveBroadcastContent
,它要么是 '即将到来"、直播"或无".
Edit: The way I implemented this, I look for snippet.liveBroadcastContent
, which is either 'upcoming', 'live' or 'none'.
通过这种方式,您可以确定视频当前是首映,还是首映已结束并且是常规视频.
This way you can identify if a video is currently a premiere, or the premiere has ended and it's a regular video.
这篇关于如何识别视频是否为首映?...通过 YouTube API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!