google drive files.list不显示非app创建的文件/文件夹

时间:2017-09-26 02:21:53

标签: python api google-drive-api

我有问题列表文件从谷歌驱动器通过谷歌驱动器API(使用python)。 我只显示通过api创建的文件。通过谷歌驱动器界面创建的文件夹中的其他文件不会显示。

SCOPES = 'https://www.googleapis.com/auth/drive.file'
store = file.Storage('storage.json')
creds = store.get()
if not creds or creds.invalid:
    flow = client.flow_from_clientsecrets('client_secret.json', SCOPES)
    creds = tools.run_flow(flow, store, flags) \
            if flags else tools.run(flow, store)
DRIVE = build('drive', 'v2', http=creds.authorize(Http()))


files = DRIVE.files().list().execute()

for item in files.get('items', []):
    print('Found file: %s (%s)' % (item.get('title'), item.get('id')))

0 个答案:

没有答案