Workround: Since I only need access to spreadsheets , I used gspread instead , oauth2 is much simpler with it
Im trying to download a file using pydrive (python google drive api)
My code worked for me ,I didn't change anything but now it wont work
I made sure to make the file public (even though it worked even when it was private)
This is the relevant part of the code:
gauth = GoogleAuth()
gauth.GetFlow()
# Try to load saved client credentials
gauth.LoadCredentialsFile("mycreds.txt")
if gauth.credentials is None:
# Authenticate if they're not there
gauth.LocalWebserverAuth()
elif gauth.access_token_expired:
# Refresh them if expired
gauth.flow.params.update({'access_type': 'offline'})
gauth.Refresh()
else:
# Initialize the saved creds
gauth.Authorize()
drive = GoogleDrive(gauth)
# Save the current credentials to a file
gauth.SaveCredentialsFile("mycreds.txt")
file1 = drive.CreateFile({'id': '1naQ4crE04nBmsj7yz4GNtmp-PKrCtfTHjl_AfGoTaws'})
file1.GetContentFile('Hello.csv', mimetype='text/csv')
This is the error I get in the console :
pydrive.files.ApiRequestError: <HttpError 404 when requesting https://www.googleapis.com/drive/v2/files/1naQ4crE04nBmsj7yz4GNtmp-PKrCtfTHjl_AfGoTaws?alt=json returned "File not found: 1naQ4crE04nBmsj7yz4GNtmp-PKrCtfTHjl_AfGoTaws">
And this is what the link above shows:
{
"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."
}
}
Any help appreciated , thanks
Edit : these is what I see inside the credentials of my gauth object , anything missing?