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

forked to foster mainteance/api work around #439

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@ gdrive
======


## Note
This tool is not being actively maintained at the moment, ymmv.
For incremental and encrypted backup of unix systems [borg](https://github.com/borgbackup/borg)
is a great alternative and [rsync.net](http://rsync.net/products/attic.html) provides
a cheap and reliable backup target.
## Note maintenance !
This tool is not being actively maintained at the moment, by the original developer github.com/prasmussen
I have forked his repo, to further foster interest in this tool.
My android build team use this extensivly to upload our android builds to our developer google drive accounts.

Please pull request any guides and work arounds.

## Warning, API errors while uploading is being flooded due to the popular use !
work arounds
/bin/bash work around
Credit github.com/ripee

while ! gdrive upload --parent <command string>; do sleep 1; done

Will post examples next

## Overview
gdrive is a command line utility for interacting with Google Drive.
Expand All @@ -17,6 +27,9 @@ If you want to compile from source you need the [go toolchain](http://golang.org
Version 1.5 or higher.

## Installation
Warning, compiling from source code may overwhelm API due to number of users usins the same credentials from developer
SEE tutorials for install !

### With [Homebrew](http://brew.sh) on Mac
```
brew install gdrive
Expand Down
105 changes: 105 additions & 0 deletions TUTORIAL-INSTALL-Windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
Source Document, https://github.com/prasmussen/gdrive/issues/426
Thanks TA40

Since using this tool, and compiling from source above, I have noticed a couple issues.
1. tool is pretty useful for uploading compiled binaries to my google drive developer account
2. not being maintained
3. lots of contributions including this tutorial on installing for your own API needed for tool to be effective
4. I am willing to maintain it.

summary of issues below without pictures, copy and pasted from above issue

thanks tripLr

Notes, : if you are compiling this tool, you are using a developer API from someone else, and may/will get errors
This tutorial will help you compile for your platform README.md is unchanged, other than pointing to this tutorial

### 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)](https://github.com/prasmussen/gdrive/issues/392#issuecomment-423048518) 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)
#### Linux install instructions
#### And now step by step: (Windows users ?)


1. Download "go" for windows from https://golang.org/dl/ and install it with standard settings 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
![image](https://user-images.githubusercontent.com/46388493/51983299-9a11d680-2498-11e9-81d3-fa6f6e8ddd86.png)

3. Log into your Google Account (or create one) and go to the [Google Developer API Website](https://console.developers.google.com/apis/dashboard) (and if needed accept the ToS)

4. Click on "Create Project"
![image](https://user-images.githubusercontent.com/46388493/51983494-14425b00-2499-11e9-83bd-372b88bcda37.png)

5. and then click "CREATE"
![image](https://user-images.githubusercontent.com/46388493/51983553-3e941880-2499-11e9-9e15-cb40db9e5d4f.png)

6. Give it a name (in my case "Google CLI TA40") and click "Create"
![image](https://user-images.githubusercontent.com/46388493/51983662-93d02a00-2499-11e9-91b6-b50ed28e4943.png)

7. Now go to [Google Drive API](https://console.developers.google.com/apis/library/drive.googleapis.com) and click "ENABLE"
![image](https://user-images.githubusercontent.com/46388493/51983741-cbd76d00-2499-11e9-9adb-01a742f6f2ed.png)

8. Now on the left side, click "Credentials"
![image](https://user-images.githubusercontent.com/46388493/51983847-0b9e5480-249a-11e9-8a55-48f1f93e4193.png)

9. And click "CREATE CREDENTIAL"
![image](https://user-images.githubusercontent.com/46388493/51983896-338db800-249a-11e9-92df-5bcf779942dd.png)

10. Fill the things like I did and then click on "What credentials do I need?"
![image](https://user-images.githubusercontent.com/46388493/51983961-66d04700-249a-11e9-9039-d9d15025e31f.png)

11. Give it a name (I took the name of the API)
![image](https://user-images.githubusercontent.com/46388493/51983993-86676f80-249a-11e9-85de-5e3eccd0122d.png)

12. Next select your e-mail and then give it a name (I again took the name of the API)
![image](https://user-images.githubusercontent.com/46388493/51984095-c62e5700-249a-11e9-9cc4-b8e6986b2dfd.png)

13. Click on "Download" (A .json file will be downloaded)
![image](https://user-images.githubusercontent.com/46388493/51984163-f4ac3200-249a-11e9-914a-956b956fc51d.png)

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](https://user-images.githubusercontent.com/46388493/51984552-f0ccdf80-249b-11e9-9cd3-af6d7550f3e4.png)
and save it

2. open CMD and go to the folder where the "handerls_drive.go" is.
First type this: `go get github.com/prasmussen/gdrive` (thanks to mbenlioglu [#426 (comment)](https://github.com/prasmussen/gdrive/issues/426#issuecomment-459046466))
Now type this: `go build`
Now you should have an .exe which you can use normally


You can reset your data by deleting the .gdrive Folder in %appdata%
#### Compiling an Linux/OS X/etc. version of gdrive in Windows:

Look up your OS here: https://golang.org/doc/install/source#environment
Now do this in cmd:
`SET GOOS=your os`
`SET GOARCH=your arch`
then do `go build`

EXAMPLE:
`SET GOOS=linux`
`SET GOARCH=amd64`

Hopefully anyone can translate step 16 (compiling) in linux and/or MacOS, thanks