Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to download folder from google drive? #1399

Closed
EhtishamSabir opened this issue Jun 5, 2021 · 2 comments
Closed

how to download folder from google drive? #1399

EhtishamSabir opened this issue Jun 5, 2021 · 2 comments
Labels
api: drive Issues related to the Drive API API. type: question Request for information or clarification. Not an issue.

Comments

@EhtishamSabir
Copy link

EhtishamSabir commented Jun 5, 2021

worst documentation of google drive first of all & secondly where are the sample code for python?

@parthea parthea added type: question Request for information or clarification. Not an issue. api: drive Issues related to the Drive API API. labels Jun 6, 2021
@parthea
Copy link
Contributor

parthea commented Jun 6, 2021

Hi @EhtishamSabir,

We have samples for Google Drive here and here however users have mentioned in #531 that this documentation needs improvement. Please update #531 which is linked to internal bug trackers if you have additional feedback for the Google Drive Samples. I'm going to close this issue as a duplicate of #531. I'm going to update #531 once I have an ETA from the team working on the samples.

Googlers see b/190226456 and b/185393300 for updates.

@parthea parthea closed this as completed Jun 6, 2021
@EhtishamSabir
Copy link
Author

Here there is no documentation on using pickel file for saving session. because user can't manually confirm authorization each time.

Sorry I was angry after doing lot's of searching. but please guys update documentation otherwise AWS is going to lead in next few years :)

    # Check if file token.pickle exists
    if os.path.exists('token.pickle'):
        # Read the token from the file and
        # store it in the variable self.creds
        with open('token.pickle', 'rb') as token:
            self.creds = pickle.load(token)

    # If no valid credentials are available,
    # request the user to log in.
    if not self.creds or not self.creds.valid:

        # If token is expired, it will be refreshed,
        # else, we will request a new one.
        if self.creds and self.creds.expired and self.creds.refresh_token:
            self.creds.refresh(Request())
        else:
            flow = InstalledAppFlow.from_client_secrets_file(
                'credentials.json', SCOPES)
            self.creds = flow.run_local_server(port=0)

        # Save the access token in token.pickle
        # file for future usage
        with open('token.pickle', 'wb') as token:
            pickle.dump(self.creds, token)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: drive Issues related to the Drive API API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants