I am using python to fetch files from the google shared drive, which is owned by the team. The currently issue is I can parse all the file ID's but I cannot using the pyDrive to download or read the content of the file.
First I generated a "drive":
from pydrive.drive import GoogleDrive
from pydrive.auth import GoogleAuth
from pprint import pprint
gauth = GoogleAuth()
# Create local webserver and auto handles authentication.
gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)
Then I use the file id to get the content:
file_id = 'xxx'
file_ = drive.CreateFile({'id': file_id})
content = file_.GetContentString() # <--------------problem line
print(content)
The error I got is:
pydrive.files.ApiRequestError: <HttpError 404 when requesting https://www.googleapis.com/drive/v2/files/xxx?alt=json returned "File not found: xxx">
However, the file does exist when I go to the https://www.googleapis.com/drive/v2/files/xxx?alt=json
, it return:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
}