【问题标题】:403 error code Google Drive Python The download quota for this file has been exceeded403 错误代码 Google Drive Python 已超出此文件的下载配额
【发布时间】:2016-04-15 00:33:59
【问题描述】:

我使用了 Google Drive Python 库https://developers.google.com/drive/v3/web/quickstart/python#step_1_turn_on_the_api_name

try:
    request = self.api.files().get_media(fileId=file_id)
    with open(target_path, 'wb') as local_fd:
        media_request = http.MediaIoBaseDownload(local_fd, request, chunksize=Constant.CHUNK_SIZE)
        done = False
        while not done:
            download_progress, done = media_request.next_chunk(num_retries=Constant.MAXRETRY_NUM)
            if download_progress:
                logger.debug('Sleep 5 Download Progress: %d%%' % int(download_progress.progress() * 100))
            sleep(5)
except Exception, exp:
    return self.__exp_handler(exp)

下载大文件时收到403错误

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "quotaExceeded",
    "message": "The download quota for this file has been exceeded",
    "locationType": "other",
    "location": "quota.download"
   }
  ],
  "code": 403,
  "message": "The download quota for this file has been exceeded"
 }
}

无论块大小如何,它总是在 53 请求下载之后发生。

我在处理程序错误中没有看到任何错误。

【问题讨论】:

    标签: python google-drive-api


    【解决方案1】:

    2016-08-12 更新:这个问题现在应该已经解决了。

    这似乎是我们计算下载配额的一个错误,因为分块下载只能算作一次下载。工程团队已经意识到了这个问题,如果在我们的跟踪器上提出问题,我可以在我们了解更多信息时进行更新:

    https://code.google.com/a/google.com/p/apps-api-issues/

    【讨论】:

    • 我还是不明白原因。即使是错误的计算,但如何使用“请求/第 0 天的 1,000,000,000 个请求/100 秒/用户 1,000 个”超过配额 - 我的应用程序的限制
    • Google Drive API 强制执行额外的、未记录的配额,以保护我们的后端免受滥用。遗憾的是,这些额外配额的具体细节无法公开。
    • 我们推出了一个我们认为应该可以解决此问题的修复程序。如果您仍然发现问题,请告诉我们。
    • @EricKoleda 是 downloadQuotaExceeded 不能公开的配额之一?我找不到有关403 Forbidden 错误的任何信息,该文本为reason。谢谢!
    猜你喜欢
    • 2018-05-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-27
    • 1970-01-01
    • 2018-10-26
    • 1970-01-01
    相关资源
    最近更新 更多