SO中的第一篇文章。抱歉,如果我问一个愚蠢的问题。
我想将计算机中的照片上传到Google照片中。
A,我在API中找不到自己的脚和手。 OAuth 2.0 help page建议使用json来实现,就像这样:
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')
我了解它需要打开浏览器并获得重定向的回复(对于我而言,这当然不会发生)
我的问题:
++++编辑++++
由于有了好人和好答案,我设法走了一半:-)
我可以运行this示例,并列出驱动器中的前10个文件。 当我调用build命令时出现问题。 原始行显示:
from googleapiclient.discovery import build
service = build('drive', 'v3', credentials=creds)
this页列出了所有类型的API,缺少照片/ picasa /可以上传照片的任何内容:-\
有什么想法吗?