使用API上传YouTube

2024-05-23 20:59:40 发布

您现在位置:Python中文网/ 问答频道 /正文

这是什么意思

我上传一个视频后出现这个错误。 我想这会让我上传youtube变得更容易。 有人能帮我吗

client_secret.json-youtube-v3-(['https://www.googleapis.com/auth/youtube.upload'],)
['https://www.googleapis.com/auth/youtube.upload']
youtube service created successfully
Traceback (most recent call last):
  File "c:/Users/dipes/OneDrive/Desktop/Upload YouTube/upload.py", line 197, in <module>
    response_upload = service.videos().insert(
  File "C:\Users\dipes\AppData\Local\Programs\Python\Python38-32\lib\site-packages\googleapiclient\_helpers.py", line 134, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "C:\Users\dipes\AppData\Local\Programs\Python\Python38-32\lib\site-packages\googleapiclient\http.py", line 907, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/upload/youtube/v3/videos?part=snippet%2Cstatus&alt=json&uploadType=multipart returned "The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.">

Tags: inpyhttpscomyoutubewwwlinev3
1条回答
网友
1楼 · 发布于 2024-05-23 20:59:40

从错误消息中:

"The request cannot be completed because you have exceeded your <link> quota"

您已超过配额,请阅读以下内容: https://developers.google.com/youtube/v3/getting-started#quota

简言之:

从上面的链接: 谷歌通过为每个请求分配成本来计算配额使用率。不同类型的操作具有不同的配额成本。例如:

  • 检索资源列表(频道、视频、播放列表)的读取操作通常花费1个单位
  • 创建、更新或删除资源的写入操作通常需要花费50个单位
  • 一个搜索请求需要100个单位
  • 一个视频上传需要1600个单元

相关问题 更多 >