gpt4 book ai didi

youtube-api - 检索 YouTube v3 API 中的所有新订阅视频

转载 作者:行者123 更新时间:2023-12-03 11:23:05 28 4
gpt4 key购买 nike

我需要知道 YouTube 数据 API v3 中的等效请求,因为此 v2 请求用于检索所有新订阅视频。

https://gdata.youtube.com/feeds/api/users/default/newsubscriptionvideos

我还没有看到任何像 v2 版本的请求一样简单干净的请求

最佳答案

对于任何有兴趣“今天”检索新上传视频的人,例如 /feed/subscriptions 中的操作方式,使用“搜索 API”(link)。

在这种情况下,它需要 2 个 API。搜索 API 和订阅 API (link)

  • 使用订阅 API
  • 获取 channel ID
  • 对于每个 channel ID,使用带有 channelId 的搜索 ID , publishedAfterpublishedBefore参数。
  • 然后过滤掉具有 items.length == 0 的结果.

  • 那么现在,您可以仅过滤订阅 channel 上传的最新视频。

    编辑 : 搜索 API 需要 100 个配额。:

    A call to this method has a quota cost of 100 units.



    播放列表项 API 需要 3 个配额:

    A call to this method has a quota cost of 1 unit in addition to the costs of the specified resource parts.



    所以......从“ channel API”缓存上传播放列表ID并使用播放列表要便宜得多。

    或者要能够通过搜索 API 等发布日期进行过滤,请使用具有 publishedBefore 的事件 API和 publishedAfter参数。

    关于youtube-api - 检索 YouTube v3 API 中的所有新订阅视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19640796/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com