0

I try to download files from google drive on server (via python). For small numbers of file it is OK, but when I download more files, I get "permission deny: ("Sorry, but your computer or network may be sending automated queries, ...". OK, OK, understand. ). Python code (with ban from google) is based on this snippet: https://github.com/ndrplz/google-drive-downloader/blob/master/google_drive_downloader/google_drive_downloader.py

When I switch to Drive API (and create app with permission, scope, ...) I must request scope with read access to client's drive. But I can't do it. I only need download public file, I don't need read all others files. I can't make client scared.

Is it here some solution: I will make login to my google account and google drive allow to me download public file without ban, limitation, ...?

Thanks for any idea.

Dingo
  • 2,656
  • 1
  • 19
  • 16

1 Answers1

2

It's not possible to download public a file with a more restricted scope. It needs at least the drive.readonly scope. This of course means your App would have read permissions for the entire Drive. Meanwhile, drive.file is limited to files created/opened by your App:

(drive.file): Per-file access to files created or opened by the app. File authorization is granted on a per-user basis and is revoked when the user deauthorizes the app.

There is a feature request in Google's Issue Tracker asking for this behavior to change. You can click on the star next to the issue number to give more priority to the request and to receive updates.


However, a workaround would be using an API Key instead of Oauth authentication.

Jescanellas
  • 2,555
  • 2
  • 9
  • 20