I have successfully used this client_secret.json to authenticate with Google API and read gSheet data, but now I am trying to upload a file to Drive using pydrive.
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gauth = GoogleAuth()
gauth.LoadClientConfigFile('client_secret.json') # fails here
drive = GoogleDrive(gauth)
gfile = drive.CreateFile()
gfile.SetContentFile('myfile.txt')
gfile.Upload()
Error: InvalidConfigError('Invalid client secrets file %s' % error) pydrive.settings.InvalidConfigError: Invalid client secrets file Invalid file format See https://developers.google.com/api-client-library/python/guide/aaa_client_secrets Expected a JSON object with a single property for a "web" or "installed" application