YouTube 数据 API 搜索不支持在日期之后发布 [英] YouTube Data API search not honoring publish after date
问题描述
我有这个查询
YouTube.Search.List search = youtube.search().list("id");
search.setOrder("viewCount");
search.setMaxResults(50);
search.setPublishedAfter(new DateTime(publishedAfterDate));
search.setPublishedBefore(new DateTime(new Date()));
search.setType("video");
search.setKey(getYoutubeKey());
直到几个月前它都运行良好.然后,突然之间,Google 似乎必须更改其数据 API 中的某些内容,并且不再遵守PublishedAfter"日期.
Which was working perfectly fine up until a few months ago. Then, all of a sudden it seems that Google must have changed something in their data API and the "PublishedAfter" date is no longer being honored.
我检查了调试器,publishedAfterDate"的值解析得很好.我对一周前发布的视频的查询现在返回一年前的视频.没有任何错误或类似的情况,当几个月前完全相同的代码运行良好时,API 只是没有返回正确的结果.
I checked in a debugger and the value of "publishedAfterDate" resolves just fine. My query for videos published after one week ago is now returning videos from a year ago. There are no errors or anything of that sort, the API just doesn't return the correct results when the same exact code was working perfectly fine a few months ago.
有什么想法吗?
另一个奇怪的花絮,在现场演示中,如果您单击所有时间",您会注意到数据 API 甚至不止一次返回相同的视频.这很奇怪,几个月前也没有发生过.
Another weird tidbit, on the live demo if you click "All Time", you'll notice that the data API is even returning the same videos more than once. This is very weird and also didn't used to happen a few months ago.
推荐答案
此问题与以下几个相关:
This issue is related to the following ones:
另请参阅 Google 的问题 #128673552,https://issuetracker.google.com/issues/128673552.
See also Google's issue #128673552, https://issuetracker.google.com/issues/128673552.
这篇关于YouTube 数据 API 搜索不支持在日期之后发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!