我正在从 java 项目中按关键字搜索,就像在示例中一样 -
https://developers.google.com/youtube/v3/code_samples/java#search_by_keyword
它工作得很好,但是当我添加到示例中时 PublishedAfter 选项 search.setPublishedAfter(myDateTime);
它返回错误 400 消息”:“错误请求”
YouTube.Search.List search = youtube.search().list("id,snippet");
String apiKey = properties.getProperty("youtube.apikey");
search.setKey(apiKey);
search.setQ(queryTerm);
search.setPublishedAfter(myDateTime) // the code works when removing this line
search.setFields("items(id/kind,id/videoId,snippet/title,snippet/thumbnails/default/url)");
search.setMaxResults(NUMBER_OF_VIDEOS_RETURNED);
SearchListResponse searchResponse = search.execute();
List<SearchResult> searchResultList = searchResponse.getItems();
我想使用 setPublishedAfter 选项
请帮忙谢谢