YouTube API:如何获取用户将视频标记为收藏的日期/时间?
我正在通过 YouTube API 访问用户最喜欢的视频的提要。我如何获取他将每个视频标记为收藏的日期/时间?
更新:
有人指出 YouTube API 文档 表示用户最喜欢的提要上的“发布”日期将包含用户将视频标记为最喜欢的时间。但这似乎是错误的。
例如,请观看以下视频条目:
http://gdata.youtube.com/feeds/ api/videos/g2981r_MtHQ
它的“发布”日期为 2008-03-19T21:09:09.000Z
。
现在让我们在某个用户的收藏夹 Feed 中查看相同的视频:
http://gdata .youtube.com/feeds/api/users/KeepWatchingTheSkies/favorites
它的“发布”日期为 2008-03-19T21:09:09.000Z
。完全相同的。
以下是获取收藏夹 Feed 的另一种方式:
http://gdata.youtube。 com/feeds/base/users/KeepWatchingTheSkies/favorites
我们仍然有一个“发布”日期 2008-03-19T21:09:09.000Z
。
假设用户在视频发布的同一毫秒内没有足够快地收藏该视频,那么 YouTube 文档中的内容可能是错误的,并且这不是用户将视频标记为的时间最喜欢的。
所以我的问题是:如何获取用户将视频标记为收藏的时间?
I'm accessing the feed of a user's favorite videos through the YouTube API. How can I get the date/time in which he marked each video as favorite?
Update:
Someone pointed out that the YouTube API documentation says that the "Published" date on a user's favorite feed will have the time in which the user marked the video as favorite. But that seems to be false.
For example, check out this video entry:
http://gdata.youtube.com/feeds/api/videos/g2981r_MtHQ
It has a "published" date of 2008-03-19T21:09:09.000Z
.
Now let's see the same video in the favorite feed of some user:
http://gdata.youtube.com/feeds/api/users/KeepWatchingTheSkies/favorites
It has a "published" date of 2008-03-19T21:09:09.000Z
. Identical.
Here is a different way to get the favorites feed:
http://gdata.youtube.com/feeds/base/users/KeepWatchingTheSkies/favorites
And still we have a "published" date of 2008-03-19T21:09:09.000Z
.
Assuming the user was not quick enough to favorite the video on the same millisecond it was published, what's written in the YouTube documentation is probably wrong, and this is not the time in which the user marked the video as favorite.
So my question is: How can I get the time at which a user marked a video as favorite?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现:URL 必须指定
?v=2
,因此将使用 API 的版本 2。以下是固定网址:
http://gdata.youtube.com/ feeds/api/users/KeepWatchingTheSkies/favorites?v=2
现在它显示了正确的“发布”时间
2010-09-03T08:59:53.000Z
。I figured it out: The URLs must specify
?v=2
so version 2 of the API will be used.Here's the fixed URL:
http://gdata.youtube.com/feeds/api/users/KeepWatchingTheSkies/favorites?v=2
Now it shows a correct "published" time of
2010-09-03T08:59:53.000Z
.这很容易。
来自 http://code.google.com/apis/youtube/2.0/ Developers_guide_protocol.html#Favorite_Videos
It's easy.
from http://code.google.com/apis/youtube/2.0/developers_guide_protocol.html#Favorite_Videos