Closed micahmo closed 3 years ago
The PlaylistItem property snippet.publishedAt
refers to the time the item was added to the playlist. Perhaps you want contentDetails.videoPublishedAt
instead? see here
@bcc32 Thanks for the response, you're exactly right! It's confusing because snippet.publishedAt
for a single video is the real published date.
Looks like it's easy to add contentDetails
to the request...
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,contentDetails& . . .
I might put together a PR for this, unless @ZeroQI beats me to it. :-)
Hey @ZeroQI,
Sorry to bother you again! Looks like this issue came back when rewrite was merged to master. Commit 92c576c overwrote the changes from PR #75.
My bad, updated while on work computer, didn't refresh agent on home computer...
No worries, I hate to bother you after all the help you've been!
It looks like the latest commit c6cae63 has a ton of changes like everything got duplicated.
I think the fix for this bug should only be two lines.
episode.originally_available_at = Datetime.ParseDate(Dict(video, 'contentDetails', 'videoPublishedAt')).date(); Log.Info('[ ] publishedAt: {}'.format(Dict(video, 'contentDetails', 'videoPublishedAt' )))
. . .
YOUTUBE_PLAYLIST_ITEMS = YOUTUBE_API_BASE_URL + 'playlistItems?part=snippet,contentDetails&maxResults=50&playlistId={}&key={}'
pasted without ctrl+A prior seemingly... Thanks for spotting
Thanks, all good now. Appreciate your help and time, as always!
Hi @ZeroQI, back again! I hope this hasn't been covered already (I scoured the issues), but it seems like there is occasionally a discrepancy between the
publishedAt
date returned by the items in the playlist API call vs the direct video info call.(BTW, I'm using your latest code from
rewrite
.)Take this video, for example: LlKnEgPEGmA
The playlist API call returns this date.
The video API call returns this date.
I was able to "fix" the issue by going directly to the video info (just like the movie code). See this snippet with my additions.
However, I'm assuming you don't want to hit the individual video API for every video again, so I'm not sure what the permanent fix is. For me, I'm nowhere near my API quote, so I don't mind adding this, but I'm not sure if others can say the same.
Maybe it can be optional for those with a low quote that also have issues with video dates?