【发布时间】:2020-04-29 21:44:15
【问题描述】:
我有一个包含近 800 个视频的 YouTube 频道。我正在使用 YouTube Data API V3 来更新每个视频的标题和说明。
这是我正在进行的更新类型的 cURL 示例:
curl --request PUT \
'https://www.googleapis.com/youtube/v3/videos?part=snippet' \
--header 'Authorization: Bearer ACCESS_TOKEN' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"id":"xxxxxxxxxxx","snippet":{"description":"Updated description, often quite long","title":"Updated title","channelId":23}}' \
--compressed
这(最终)工作得很好。因此,我着手进行批量更新,为每个视频生成新的标题和描述,并发出单独的 PUT 请求。
问题是,在收到警告之前,我成功更新了大约 175 次:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceeded",
"message": "Daily Limit Exceeded. The quota will be reset at midnight Pacific Time (PT). You may monitor your quota usage and adjust limits in the API Console: https://console.developers.google.com/apis/api/youtube.googleapis.com/quotas?project=xxxxxxxxxxxxx",
"extendedHelp": "https://console.developers.google.com/apis/api/youtube.googleapis.com/quotas?project=xxxxxxxxxxxxx"
}
],
"code": 403,
"message": "Daily Limit Exceeded. The quota will be reset at midnight Pacific Time (PT). You may monitor your quota usage and adjust limits in the API Console: https://console.developers.google.com/apis/api/youtube.googleapis.com/quotas?project=xxxxxxxxxxxxx"
}
}
我在不到 200 次更新中使用了每天 10,000 个请求配额。这怎么可能?
是否有一种方法可以在一个 PUT 请求期间更新多个视频 ID。配额数量如何计算?我似乎找不到任何关于它的数据。
【问题讨论】:
标签: youtube youtube-api youtube-data-api