403错误代码Google Drive Python已超出此文件的下载配额 [英] 403 error code Google Drive Python The download quota for this file has been exceeded

查看:179
本文介绍了403错误代码Google Drive Python已超出此文件的下载配额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I used Google Drive Python library 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错误

and received 403 error when download large file

{
 "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个请求下载后发生.

It always happens after 53 request download regardless of chunk size.

我看不到处理程序错误中的任何错误.

I do not see any error in the handler error.

推荐答案

更新2016-08-12 :现在应解决此问题.

Update 2016-08-12: This issue should now be resolved.

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

This appears to be a bug in how we calculate download quota, since chunked downloads should only count as one download. The engineering team is aware of the problem, and if file an issue on our tracker I can update when we know more:

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

这篇关于403错误代码Google Drive Python已超出此文件的下载配额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆