我有一个YouTube频道,有近800个视频。我正在使用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
终于可以正常工作了 This is (finally) working great. 所以我开始做一个批量更新,我为每个视频生成新的标题和描述,然后拍下单个的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"
}
}
我已经使用了我的10,000日请求配额 在不到200个更新。这怎么可能呢?
或许有什么方法可以让我在一次PUT请求中更新多个视频ID。配额数是如何统计的?我好像找不到相关数据。
文档 配额计算器 说,调用 Videos.update
端点 snippet
部分的配额成本为53个单位。
因此,如果每天的配额达到10000个--如果只计算更新的话--你不能得到超过188个视频的配额。snippet
元数据在任何一天更新。