3

Sorry for my english. I use pydrive for work whith google drive api. I want get list of files. I do it like this:

  return self.g_drive.ListFile({'q': 'trashed=false'}).GetList()

this return me list of files. But it list contains delete files. I think 'q': 'trashed=false' it get only exist files, not in the bucket.

How i can get only exist files and files shared with me

Nabin
  • 11,216
  • 8
  • 63
  • 98
nesalexy
  • 848
  • 2
  • 9
  • 30

1 Answers1

5

Remove the trashed=false and query to get shared files is: sharedWithMe Also there is no concept of bucket in google drive

Query to use:

{'q': 'sharedWithMe'}

EDIT

I still believe trashed=false should work

Work around:

There must be a better way but a trick is to do the following:

list_of_trash_files = drive.ListFile({'q': 'trashed=true'})
list_of_all_files = drive.ListFile({'q': ''})
final_required_list = set(list_of_all_files) - set(list_of_trash_files)
Nabin
  • 11,216
  • 8
  • 63
  • 98