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

Google Response Format Has Changed #73

Open
bryanptom opened this issue Jul 11, 2022 · 0 comments
Open

Google Response Format Has Changed #73

bryanptom opened this issue Jul 11, 2022 · 0 comments

Comments

@bryanptom
Copy link

As a few other issues seem to be noticing, Google's format for responding to Google Doc API download requests has changed. This has broken the download_file_from_google_drive function, which makes most of the package unusable since the model params cannot be downloaded successfully.

I was able to circumvent this problem by making a quick change to the seq_modeling.downloads.download_file_from_google_drive function, just by adding these lines at the bottom of the function:

saved_size = os.path.getsize(destination)
if saved_size < 10000:
      response = session.get(URL, params={'id': id, 'confirm': 't'}, stream = True)
      save_response_content(response, destination)

I haven't tested very much, so I'm not sure if one could just drop the confirm: t param into all requests, regardless of whether confirmation is actually necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant