I am trying to use PyDrive to get a list of all files in my Google Drive. I have read through the docs and completed all steps. I have client secrets.json saved down, but I continue to get the following error. The code I am using is:
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
# Creates local webserver and auto handles authentication
drive = GoogleDrive(gauth)
file_list = drive.ListFile({'q': "'root' in parents and trashed=false"}).GetList()
for file1 in file_list:
print 'title: %s, id: %s' % (file1['title'], file1['id'])
The error I am getting is, how to do I fix this?
Traceback (most recent call last):
File "C:\Users\mydrive\Documents\Python\Google_Drive.py", line 5, in <module>
gauth.LocalWebserverAuth()
File "build\bdist.win-amd64\egg\pydrive\auth.py", line 67, in _decorated
self.GetFlow()
File "build\bdist.win-amd64\egg\pydrive\auth.py", line 345, in GetFlow
self.LoadClientConfig()
File "build\bdist.win-amd64\egg\pydrive\auth.py", line 294, in LoadClientConfig
self.LoadClientConfigFile()
File "build\bdist.win-amd64\egg\pydrive\auth.py", line 314, in LoadClientConfigFile
raise InvalidConfigError('Invalid client secrets file %s' % error)
InvalidConfigError: Invalid client secrets file File not found: "client_secrets.json"