First post in SO. Sorry if I ask dumb questions.
I want to upload photos from my computer to google photos.
Alas, I cannot find my feet and hands in the API. The OAuth 2.0 help page suggest to do it with a json, like so:
from oauth2client.client import flow_from_clientsecrets
flow = flow_from_clientsecrets('path_to_directory/client_secrets.json',
scope='https://www.googleapis.com/auth/calendar',
redirect_uri='http://example.com/auth_return')
And I understand it demands to open a browser and get the reply in the redirection (which of course doesn't happen in my case)
My questions:
- Is there a way to do it in a headless machine?
- Assuming all I want is to use my local machine, and I don't own a DNS, what address should I use for the redirection?
- Does anyone have a reference code to use?
++++ Edit ++++
Thanks for the good people and their good answers, I managed to go half the way :-)
I can run this example, and list my 10 first files in drive. The problem appears when I call the build command. Original line says:
from googleapiclient.discovery import build
service = build('drive', 'v3', credentials=creds)
And this page lists all kind of APIs, missing the photos / picasa / whatever to make the photos be uploaded :-\
Any idea ?