本文介绍了获取视频的发布日期 - 不是上传日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Youtube 的 Data API V3,我试图获取发布视频的日期,即您在观看页面上看到的日期:

Using Youtube's Data API V3, I am trying to get the date at which the video was published i.e. the date you see displayed here on the watch page:


使用 API,我只能获得上传日期,这显然不受预定发布的影响.

Using the API, I have only been able to get the upload date which obviously doesn't get affected by scheduled releases.

起初我尝试使用 playlistItems在用户的上传播放列表中.我很快发现发布日期实际上是该项目添加到播放列表的日期(在这种情况下上传日期)

At first I tried using playlistItems on the user's upload playlist. I soon found out that the published at date was actually the date this item was added to the playlist (which in this cases is the upload date)

然后我转向使用videos使用从上传播放列表中获取的 ID.我假设因为我不再使用父列表中的数据,publishedAt 将是实际发布日期,但不,仍然是上传日期.

I then turned to using videos with the id fetched from the upload playlist. I assumed since I was no longer using data from within a parent list, the publishedAt would be the actual published at date, but no, still the upload date.

statussnippetstatistics 等部分均未给出发布日期.

None of the parts including status, snippet, and statistics give the published date.

那么...我如何获得这样的约会?

So... How do I get such a date?

谢谢.

推荐答案

videos/list,使用 snippet 部分,您现在拥有 snippet.publishedAt,这是观看页面上的日期(也是用于构建订阅源的日期).

In videos/list, with snippet part, you now have snippet.publishedAt, which is the date on the watch page (and the one used to build the subscriptions feed).

这篇关于获取视频的发布日期 - 不是上传日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 05:46