I have this code:
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
import time
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)
# Auto-iterate through all files that matches this query
file_list = drive.ListFile({'q': "'root' in parents"}).GetList()
for file1 in file_list:
print 'title: %s, id: %s' % (file1['title'], file1['id'])
time.sleep(1)
However, each time I want to run it, it opens my browser and asks for permission to access google drive. How to bypass it? I mean at least ask once, then save the "permission" and don't ask again or (which would be best) silently accept the permission in the background without my decision. I have downloaded client_secrets.json which is used for passing the authorization details.
What if I wanted to release my application? I mean I had to generate + download the client_secrets.json in order to make it work. I guess my users wouldn't wanto to do so. Is there any better, more convenient way?
I would also appreciate a tutorial-for-dummies about using Google Drive API because it's hard for me to understand it reading the documentation alone.