rClone with Google Drive API - Error 403
Have you tried to use rClone with Google Drive and hit an error Failed to get file: googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded this is down to a rate limit on the speed of the upload to get around this you need to use the Google API’s directly which allow you to upload without a restrcition.
Install rClone
curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip unzip rclone-current-linux-amd64.zip cd rclone-*-linux-amd64 #Copy binary file sudo cp rclone /usr/bin/ sudo chown root:root /usr/bin/rclone sudo chmod 755 /usr/bin/rclone #Install manpage sudo mkdir -p /usr/local/share/man/man1 sudo cp rclone.1 /usr/local/share/man/man1/ sudo mandb
Create Google Drive API Project
https://console.developers.google.com/apis/dashboard
Create a new Project so you can see the API usage
Then enable APIs and Services
Search for Google Drive API and Enable it
Google API – Credentials
Next we need to give the API Permissions to access your Google Drive
Then give Consent
save
Next create the OAuth Client ID
Now make a note of both the client ID and secret key
Putty Tunnel
Now we need to have rclone use the new API key
For the next part we will need to create a SSH tunnel in order to complete the rclone google authorization.
In the session connection you have for server you are connecting to add the following , you can remove it after you have authorized the API
Configure rClone
Now we need to have rclone use the new API key
rclone config new remote – google Storage – Google Drive Client id – use client key from above step Client_secret – use secret key from above step Scope – full Root-folder – default Service-account-file – default Advanced – no Auto-config – yes Authorization - http://127.0.0.1:53682/auth
Now open up a web browser with the following and authorize the API we created earlier
Team Drive – No
Y to confirm
Troubleshooting
At the time of writing there is a 1,000,000 queries per day limit