I have a working authentication&file-uploading to dropbox. Now, I would like to make this authentication&file-uploading to google drive. But I have a problem which is the following:
I need to login in google for the first time when I run the script above. In dropbox I don't need to login to upload a file.
Is it possible in google too?
Thanks
Google Drive:
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)
file5 = drive.CreateFile()
# Read file and set it as a content of this instance.
file5.SetContentFile('dark.jpg')
file5.Upload() # Upload the file.
dropbox:
import dropbox
dbx = dropbox.Dropbox('xxxxxxxxxx-xxxxxxxxxx')
with open(file_name, "rb") as f: # path
dbx.files_upload(f.read(), '/' + pre_fn + current_time +'.jpg', mute = True)
f.close()