Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/354.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用python中的apiclient在googledrive中获取其他自己的文件?_Python - Fatal编程技术网

如何使用python中的apiclient在googledrive中获取其他自己的文件?

如何使用python中的apiclient在googledrive中获取其他自己的文件?,python,Python,我尝试了get方法,但未找到响应文件。 当我得到其他自己的文件时。 当我获得文件信息时,我会创建自己的文件。这是可能的。 如何访问其他自己的文件。。。 这是我的密码 文件id值替换[谷歌id]导致安全 SCOPES = ['https://www.googleapis.com/auth/drive.file', 'https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive.appdata

我尝试了get方法,但未找到响应文件。 当我得到其他自己的文件时。 当我获得文件信息时,我会创建自己的文件。这是可能的。 如何访问其他自己的文件。。。 这是我的密码 文件id值替换[谷歌id]导致安全

SCOPES = ['https://www.googleapis.com/auth/drive.file',
'https://www.googleapis.com/auth/drive',
      'https://www.googleapis.com/auth/drive.appdata',
      'https://www.googleapis.com/auth/drive.scripts',
'https://www.googleapis.com/auth/drive.file',
'https://www.googleapis.com/auth/drive.metadata'
]
credentials = get_credentials()
http = credentials.authorize(httplib2.Http())
service = discovery.build('drive', 'v2', http=http)

file_id = '[google_id]'
file = service.files().get(
    fileId=file_id, supportsTeamDrives=True).execute()
new_title = '[bob]'
file['title'] = new_title
new_filename = '[bob].mp4'
new_revision = True
updated_file = service.files().update(
    fileId=file_id,
    body=file,
    newRevision=new_revision,
    media_body=('__init__.py'), supportsTeamDrives=True).execute()
print(repr(updated_file))

我解决了删除凭证文件的问题。
所以我没有访问该文件的权限。谢谢。

很抱歉,我不知道你想做什么。@OldBunny2800当文件所有者试图访问不是我的但我已授权的内容时,它会说找不到该文件。我应该怎么做?我正在尝试使用Google客户端python api的get函数获取文件信息,但我不是该文件的所有者。我只是通过共享并收到该文件的授权。错误消息“returned”file not found::