1

I successsed to have all my shared drive IDs but when I am trying to read these it returns me empty an list:

for myfile in file_list:
    if myfile['id'] == 'file_id' and myfile['title'] == 'file_tittle' :
        file_list =  drive.ListFile({'q':"'file_id' in parents and trashed=false"}).GetList()
        for i in file_list:
            print(i)
Hasttte
  • 33
  • 4

1 Answers1

1

You need to set the parameters supportsAllDrives and includeItemsFromAllDrives to true

This is specified in the Parameters section for the method.

Sample:

file_list = drive.ListFile({
    'q': "'file_id' in parents and trashed=false",
    'supportsAllDrives': True,  
    'includeItemsFromAllDrives': True
}).GetList()
ziganotschka
  • 25,866
  • 2
  • 16
  • 33
  • And for sort by img/jpeg like in GDrive, you have an option that display all img in a folder (even if there are some in sub-folder) Thanks – Hasttte Aug 30 '20 at 20:07
  • You can specify in the query `mimeType = 'image/jpeg'` but unfortunately it will not return you the results in the subfolders - for this you have to manually iterate through all subfolders. – ziganotschka Aug 31 '20 at 07:46
  • Thanks you so much ! – Hasttte Aug 31 '20 at 10:37