Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YouTube API: How can I get the date/time in which a user marked video as favorite?

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?

like image 908
Ram Rachum Avatar asked Nov 15 '22 05:11

Ram Rachum


1 Answers

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.

like image 91
Ram Rachum Avatar answered Jan 01 '23 09:01

Ram Rachum