Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

TUTORIAL: How to get rid of 403 Errors #426

Description

@TanukiAI

How to get rid of 403 errors

Many people get Errors like
Failed to get file: googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded
and thanks to LINKIWI #392 (comment) I found a way to fix it properly.

What causes the problem?

The developer made one API for this program and an Google API can "only" make 10 million requests at a day. That means that too many people use this program and the requests gets full.

How much does an own API cost?

Nothing, Google made them free for everyone.

How do I fix it then?

You have to make an own API, download the programing language go, change the API to your own one and compile it to an .exe.
(And btw. binary editing resulted in errors)

And now step by step:

  1. Download "go" for your platform from https://golang.org/dl/ and install it following the instructions for your platform here and download Git from https://git-scm.com/downloads and install it with standard settings

  2. Download the repository as .zip from GitHub and unzip it in a new folder or simply execute
    git clone https://github.com/gdrive-org/gdrive.git
    image

  3. Log into your Google Account (or create one) and go to the Google Developer API Website (and if needed accept the ToS)

  4. Click on "Create Project"
    image

  5. and then click "CREATE"
    image

  6. Give it a name (in my case "Google CLI TA40") and click "Create"
    image

  7. Now go to Google Drive API and click "ENABLE"
    image

  8. Now on the left side, click "Credentials"
    image

  9. And click "CREATE CREDENTIAL"
    image

  10. Fill the things like I did and then click on "What credentials do I need?"
    image

  11. Give it a name (I took the name of the API)
    image

  12. Next select your e-mail and then give it a name (I again took the name of the API)
    image

  13. Click on "Download" (A .json file will be downloaded)
    image

  14. Open the .json file in the editor of your choice.(Notepad++ prefered)
    You should see :

  • "client_id" which looks like this: 81915486XXXX-XXXX22bh62ql2rbnaqtpds82od4ql976.apps.googleusercontent.com
  • "client_secret" which are random characters like this: lnA7ZFg5NEGOMpFhd6e4Pqny
  1. In the unzipped repository open the file names "handlers_drive.go" (via Notepad++) and change these 2 variables to the ones you got in step 14
    image
    and save it

  2. open CMD/terminal and go to the folder where the "handerls_drive.go" is.
    First type this: go get github.com/prasmussen/gdrive (thanks to mbenlioglu TUTORIAL: How to get rid of 403 Errors #426 (comment))
    Now type this: go build -ldflags '-w -s'
    Now you should have an executable for you platform which you can use normally

You can reset your data by deleting the %appdata%\.gdrive on Windows, $HOME/.gdrive on other platforms

Cross Compiling a Linux/OS X/Windows etc. version of gdrive from your device:

If you want to compile the binary for an OS other than the one you're using you should first set GOOS and GOARCH variables for that system.
Look up your target OS here: https://golang.org/doc/install/source#environment

Now do this in terminal:
On Windows:

SET GOOS=your os
SET GOARCH=your arch

On Mac OS/Linux:

export GOOS=your os
export GOARCH=your arch

then do go build -ldflags '-w -s'

Example variables if target platform is a 64 bit Linux machine:
GOOS=linux
GOARCH=amd64


Edit: Updated to cover all platforms

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions