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屋!