Skip to content

When shared by link files.list() not showing inner folders unless they clicked by user in drive.google.com #1602

Open
@uaArsen

Description

@uaArsen

Environment details

  • OS type and version: Windows 10
  • Python version: Python 3.8.2
  • pip version: 21.3.1
  • google-api-python-client version: 2.28.0

Steps to reproduce

  1. Create following structure in Google Drive:
    image
  2. Share by link test1 to another account
  3. Open link, but do not click on folder test2 and test3
  4. Execute code below. Expected to see folders test1, test2 and test3. But only test1 is in output
  5. Open link again and click on folder test2
  6. Execute code below. Expected to see folders test1, test2 and test3. But only test1and test2 are in output

Code example

        folders = drive.files().list(pageSize=10,
                                     q='mimeType = 'application/vnd.google-apps.folder'',
                                     fields="nextPageToken, files(id, name,  parents)").execute()
        nextPageToken = folders.get('nextPageToken')
        while nextPageToken:
            nextPage = drive.files().list(pageSize=10,
                                          driveId=drive_id,
                                          q='mimeType = 'application/vnd.google-apps.folder'',
                                          fields="nextPageToken, files(id, name,  parents)",
                                          pageToken=nextPageToken).execute()
            nextPageToken = nextPage.get('nextPageToken')
            folders['files'] = folders['files'] + nextPage['files']
        print(folders)

Note: if share folder with share button and adding email it output all the inner folders immediately.

If explanation is not clear I can record a video of it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: investigatingThe issue is under investigation, which is determined to be non-trivial.type: questionRequest for information or clarification. Not an issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions