Youtube Data API 搜索:列表返回不真实的结果?

发布于 2025-01-13 05:46:35 字数 903 浏览 2 评论 0原文

例如,

//php code
  $client = new Google_Client();
  $client->setDeveloperKey($DEVELOPER_KEY);
  $youtube = new Google_Service_YouTube($client);
  $searchResponse = $youtube->search->listSearch('id', array(
    'part' => "snippet",
    'type' => "channel",
    'maxResults' => "50",
    'order' => "viewCount",
    'publishedAfter' => "2021-10-25T00:00:00Z",
    'publishedBefore' => "2021-10-25T23:59:59Z",
    'regionCode' => "JP",
));

此查询仅返回 9 个频道(并且多个频道的 RegionCode 不是 JP)。 此过滤器下应该有超过 9 个通道,因为 UCUJNWCiqMT_UudVRSSGZ3SA 等通道 id 满足所有条件(由 Channels API 返回的信息证明),但未包含在这 9 个通道中。 我尝试添加条件 'safeSearch' => “none”, 但它也不起作用。

这只是一个例子,表明 Youtube Data API Search: list 似乎只返回一小部分数据(至少在频道的情况下),这是不现实的。

是我的代码错误还是这个 API 只提供不完整的结果? 我怎样才能得到可靠的结果?

此致

For instance,

//php code
  $client = new Google_Client();
  $client->setDeveloperKey($DEVELOPER_KEY);
  $youtube = new Google_Service_YouTube($client);
  $searchResponse = $youtube->search->listSearch('id', array(
    'part' => "snippet",
    'type' => "channel",
    'maxResults' => "50",
    'order' => "viewCount",
    'publishedAfter' => "2021-10-25T00:00:00Z",
    'publishedBefore' => "2021-10-25T23:59:59Z",
    'regionCode' => "JP",
));

This query return only 9 channels (and the regionCode of several channels are not JP).
There should be more than 9 channels under this filter because channel id such as UCUJNWCiqMT_UudVRSSGZ3SA satisfy all conditions (proved by the information return by Channels API) but was not contained in those 9 channels.
I have tried to add condition 'safeSearch' => "none", but it doesn't work either.

This is just an example to show that Youtube Data API Search: list seems only return a small piece of data (at least in the case of channels) which were unrealiable.

Was my code wrong or this API does only provide incomplete results?
How could I get realiable results?

Best regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文