Git Product home page Git Product logo

gdrive's People

Contributors

alexanderkjeldaas avatar amigodeveloper avatar anmol-singh-jaggi avatar app-git-hub avatar cjangrist avatar crosbymichael avatar cypherpunksamurai avatar dirkyjerky avatar erich-roncarolo avatar fab-io avatar feschroe avatar gbinside avatar jblazquez avatar joshschriever avatar keramidasceid avatar marksteve avatar mbenlioglu avatar mberk avatar nova77 avatar paulz avatar prasmussen avatar saaros avatar singhsays avatar treeder avatar vandenoever avatar x1011 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gdrive's Issues

broken pipe uploading 500mb file

This is the error message I get when trying to upload a 500mb file.

An error occurred uploading the document: Post https://www.googleapis.com/upload/drive/v2/files?alt=json&uploadType=multipart: write tcp 74.125.28.95:443: broken pipe

trickle doesn't work with gdrive

I'm uploading 20 folders with the new folder option and it works really great!
I would like to use trickle to limit the upload bandwith but i saw it doesn't work with gdrive.

I run a command like this:
trickle -u 10 drive.go upload -p 0f4543fe2fdB8 -f /mnt/usb/

But it always use full upload bandwith.

Could you try and test it?
Thanks.

Long uploads fail when using stdin

Basically, I'm facing the same issue as in #20. As I can clearly see within the last commit, the bugfix doesn't apply to stdin and only helps when directly specifying large files. As I need both a progress bar and some ratelimiting, I've created a bashscript which recursively uploads whole directories including all files. Also, I've implemented MD5 checksumming, so that those files won't get reuploaded.

The way I'm calling this application is like that: cat largefile | pv -pteraT -L <ratelimit> -s <totalfilesize> | ./gdrive upload -s -t <filename> -p <folderid>. After quiet a few hours of uploading, it failed with "Error 401: Invalid credentials" as listed above. Could that fix also get implemented for uploading via stdin?

Error uploading big files

Uploading a big file (>20GB) to my Drive lead me to this error:

An error occurred uploading the document: Post https://www.googleapis.com/upload/drive/v2/files?alt=json&convert=false&uploadType=resumable&upload_id=CUT: dial tcp: lookup www.googleapis.com on 8.8.8.8:53: dial udp 8.8.8.8:53: too many open files

I have enough free space to upload the file and I use version 1.5.1 on ubuntu 14.04 amd64.

P.S. Am I the only one having lower uploading speed with latest version? ~1-2MB/s on a 100Mbit network.

Directory upload in Win

Great little helper, I'm just missing a couple of details:

  • Is it possible to upload full folders on a Win environment?
    I have tried all possible commands but I cannot make it work.
    drive-windows-amd64.exe upload -f test
    drive-windows-amd64.exe upload -f /test
    drive-windows-amd64.exe upload -f \test
    ...
    Any ideas?

Also, the ability of uploading new versions of a file would be a great addition, as discussed in many other posts. This would allow us to use the versioning feature in Drive.

Thanks again

Directory upload is not recursive

I suppose this is a deliberate choice, but the fact that uploading a directory only uploads the files in it (and not the subdirectories) is rather inconvenient - especially since it's not made clear.
Ideally, there should be a recursive mode but, failing that, I think that the behavior should be explicit.

`gdrive list` seems to return a max of 94 items

The gdrive list command seems to never return more than 94 items (plus a one line header). Examples:

macbookpro:~ griscom$ gdrive list -q "title != 'lksdlkjsdfljkds'" | wc
      95     790   10070
macbookpro:~ griscom$ gdrive list -q "title contains '0'" | wc
      95     790   10070
macbookpro:~ griscom$ gdrive list -q "title contains 'xml'" | wc
      31     191    3100
macbookpro:~ griscom$ gdrive list -q "title contains '1'" | wc
      95     790   10070
macbookpro:~ griscom$ gdrive list | wc
      95     790   10070
macbookpro:~ griscom$ gdrive list -q "title contains 'd'" | wc
      95     790   10070
macbookpro:~ griscom$ gdrive list -q "title contains 'l'" | wc
      95     790   10070
macbookpro:~ griscom$ gdrive list -q "title contains 'lksdflkj8833'" | wc
       1       4      31
macbookpro:~ griscom$ 

Is this a Google Drive limitation, or something inside of gdrive?

cron job configuration

Hello!

Thank you for this project. I have a problem, I am able to use the drive in a shell script, however when I set it as a cron job for the same user, it fails.

I have tried with custom config file and no changes..

Do you know how I might be able to debug it?
Thanks!

Upload speed issue

I've noticed several people here are having speed issue.

For me, I am using a VPS, which comes with at least 200MiB/s upload speed, and great peering with Google.

But my speed is kinds of limited to 1~1.5MiB/s.

Any idea what caused such problem?

@erpalma
@bxshi

Upload into a directory?

Hey @prasmussen, very well done. I see great potential in this tool, but I couldn't find any documentation and my tests failed:
how would one upload a file into an existing directory?

My plan is to automate a build script and share the binarys in a public folder on my gdrive

Thanks and keep up the good work!

Flag -i should not be needed

When working with files we could not need to provide -i with the id, it should be part of the args.

gdrive info -i aldksjfladskjf
gdrive info aldksjfladskjf

I'm not too familiar with the flags package that you are using. Do you know if the package supports taking args and populating the Options struct?

Max list at 460

For some reason, running list while querying against a parent ID (listing all files in that directory) even with a -m for max return value only returns 460 file entries... anything lower than 460 works properly, but nothing seems to work past it.

drive -a and drive -c

Hi. I was wondering how to use drive -a to change a google drive account.

drive -c doesn't seem to do anything but it may be because I have the wrong arguments.

File Type Recognition

Thank you for making this tool!
I've uploaded the apk file.

"C:\gdrive\drive-windows-386.exe" upload --file "C:\test.apk"

It seemed to be able to upload successfully. But, the file seems to be recognized as a zip file.
When I upload it manually, apk has been recognized correctly. I think it's a problem of this tool.
Thanks.

Folder support

When I use upload verb, it currently interprets slashes as it is rather than directory notation, so it makes a title with slashes in the root of the drive. I think it would be better if it supports uploading to folders.

Thanks for your great software!

long uploads fail

Uploads that take longer than 1 hour (due to file size or limited bandwidth, or both) result in:

googleapi: Error 401: Invalid Credentials, authError

from code.google.com/p/google-api-go-client/drive/v2/drive-gen.go:3481, upon googleapi.CheckResponse(res).

My assumption is that Google is testing the expired-during-transit access_key upon completion of the POST rather than at the beginning.

How to get file or folder ID by remote path?

How to get file or folder ID in remote path?

for example:
pi@PI:~$drive list --getId /RaspberryPi/Files
0b_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
(↑↑↑Don't work,just example↑↑↑)

google drive allow same filename in a folder,when it occur:
pi@PI:~$drive list --getId /RaspberryPi/Files/123.txt
0b_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2015-02-13 11:22:33
0b_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 2015-02-13 12:34:56
(↑↑↑Don't work,just example↑↑↑)

my english is not grate,please ignore my grammar problem.

File revision

Google drive provides file revision for up to 30 days,
could gdrive access those information and allow reverting to an older version ?

Also, if uploading a file with same name in the same directory, overwrite the old one instead of creating a new file.

Thanks

armv5 version

Could you provide a version for armv5 ?

When I try "drive-linux-rpi v1.6.1" on my NAS (NSA325v2) I get "Illegal instruction (core dumped)"
Using "drive-linux-arm v1.6.1" I get "runtime: this CPU has no floating point hardware, so it cannot run
this GOARM=6 binary. Recompile using GOARM=5."

NSA325 uses a Marvell Kirkwood . Looking at arch linux, this is a armv5 platform.

"-m 1" not working

Hi prasmussen

I query list normal is success but add -m 1 (to get first item) then is not result

C:\Windows\system32>gdrive list -q "title contains 'full'"
Id Title Size Created
0BxRXe4e5tCA0SlZNNWtnUEtJRUU FULL-(local)-smart_...0150225_030000.sqb 507 MB 2015-02-25 03:02:15
0BxRXe4e5tCA0ZGdpTGNhSkJCWTA FULL-(local)-smart_...0150224_030000.sqb 506 MB 2015-02-24 03:02:16
0BxRXe4e5tCA0dmFZZjlZdlljc2s FULL-(local)-smart_...0150223_030000.sqb 504 MB 2015-02-23 03:02:08
0BxRXe4e5tCA0SXlLcFZPU0huT1k FULL-(local)-smart_...0150222_030000.sqb 503 MB 2015-02-22 03:02:17
0BxRXe4e5tCA0M2VvMWp1WnJSQ0U FULL-(local)-smart_...0150221_030000.sqb 502 MB 2015-02-21 03:02:07
0BxRXe4e5tCA0TG1RNjNvZV9PNE0 FULL-(local)-smart_...0150220_030000.sqb 501 MB 2015-02-20 03:01:59
0BxRXe4e5tCA0M0d5djZtaEZkMFE FULL-(local)-smart_...0150219_030000.sqb 500 MB 2015-02-19 03:03:04
0BxRXe4e5tCA0eW8xU0lwbGRfRkU FULL-(local)-smart_...0150217_030000.sqb 499 MB 2015-02-17 03:01:56

C:\Windows\system32>gdrive list -q "title contains 'full'" -m 1
Id Title Size Created

C:\Windows\system32>

please fix error
Thanks. Your tools are very excellent work backup. I love your gdrive tool.

upload from stdin doesn't name upload file

$ echo "Hello World" | ./drive upload --stdin --title hello.txt
Id: 0B-9_enX9c21xNkRDRkowTGkwNDA
Title: untitled
Size: 12 B
Created: 2015-02-25 23:57:28
Modified: 2015-02-25 23:57:28
Owner: Carlos Garay
Md5sum: e59ff97941044f85df5297e1c302d260
Shared: False
Parents: 0AO9_enX9c21xUk9PVA
MIME Type:
Uploaded 'untitled' at 12 B/s, total 12 B

Using drive-linux-amd64 v1.5.0 on Ubuntu 14.04.1 LTS. Confirmed to also be a bug in Yosemite using drive-osx-amd64 v1.5.0

Multiple Parents

Hi

I just started using your binaries and I find it to be great. Just wanted to know if there is a provision to make multiple parents of an object being uploaded. I read somewhere that google drive gives this feature

authentication failure

gdrive can't create Drive client

root@radxa:/home# ./drive
Go to the following link in your browser:
https://accounts.google.com/o/oauth2/auth?client_id=367116221053-7n0vf5akeru7on6o2fjinrecpdoe99eg.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=state

Enter verification code: ---verification code here--
An error occurred creating Drive client: Post https://accounts.google.com/o/oauth2/token: EOF

root@radxa:/home#

Exit code is not set

Hi

When an error occurs, the exit code is still set to 0.

The error message is print but the program does not exit with none zero exit code. It can be read in the code:

fmt.Printf("An error occurred: %v\n", err)

The current behavior makes the following command to always output OK even when it should fail:
(gdrive/gdrive -c gdrive/conf upload -f tmp/* && echo OK) || echo FAIL

An error occurred uploading the document: googleapi: Error 403: The user has exceeded their Drive storage quota
OK

Upload a directory, check MD5 of files before

If uploading a directory, it reuploads file that didn't change.

Would be better to check files already on server, compare their MD5 with local files,
upload only files that changed.

Thanks

auth error

summary:  331 GiByte in 15h 42min 35.7sec - average of 6136 KiB/s
An error occurred uploading the document: googleapi: Error 401: Invalid Credentials, authError

kept getting this error when uploading large file
any suggestion?

Download links

The download links for linux version do not contain extensions. In what format are they exactly in?

gdrive doesn't show Google Docs

drive list -nq "'$fileid' in parents"

where $fileid is the ID of a folder containing .gdoc (Google Docs) files and child folders only shows the child folders.

Listing the contents of one of the child folders shows the PDFs it contains, so it seems like .gdoc files aren't visible using this tool?

Very annoying as Google Drive has begun converting all notes from .gdoc to .docx upon zip download, with no option to turn off conversion as for uploads 😞

Edit: Notes on my solution to the latter problem are here (though still unclear why this tool can't make the process easier)

upload folder, some files are missing

I just uploaded a folder with
gdrive-cli upload -f name\ folder/ -p 0123456789abcdef

Of the 7 files in folder, 2 are missing.
Is there a way to understand why? A log file, a verbose mode?

thanks

Cannot get a token for the app

I can't make the drive-linux-amd64 version (v1.6.1) pass the Google authentication step

$ wget 'https://drive.google.com/uc?id=0B3X9GlR6EmbnSWFxaExoUEk1NFk'
$ mv uc\?id\=0B3X9GlR6EmbnSWFxaExoUEk1NFk drive
$ chmod 700 drive
$ ./drive 
Go to the following link in your browser:
https://accounts.google.com/o/oauth2/auth?client_id=<***client id here***>&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=state

Enter verification code:
<*** verification code from Google here ***>
An error occurred creating Drive client: OAuthError: updateToken: Unexpected HTTP status 400 Bad Request

$ lsb_release -a
LSB Version:    core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:    12.04
Codename:   precise

Am I doing anything wrong?

10GB File Size Limitation?

Is is possible now to support files larger than 10GB?

I see in their Developer SDK site for Drive API v2 that it still says 10GB, but other sync clients such as insync support files larger than 10GB.

https://support.google.com/drive/answer/37603?hl=en
"Other files: Files that you upload but don’t convert to a Google Docs, Sheets, or Slides format can be up to 1TB each."

I would be so very happy if this great program could support files larger than 10GB.

In the mean time, loving it :)

remote import

# go build drive.go

drive.go:5:2: cannot find package "github.com/prasmussen/gdrive/cli" in any of:
        /usr/lib/go/src/pkg/github.com/prasmussen/gdrive/cli (from $GOROOT)
        ($GOPATH not set)
drive.go:6:2: cannot find package "github.com/prasmussen/gdrive/gdrive" in any of:
        /usr/lib/go/src/pkg/github.com/prasmussen/gdrive/gdrive (from $GOROOT)
        ($GOPATH not set)
drive.go:7:2: cannot find package "github.com/prasmussen/gdrive/util" in any of:
        /usr/lib/go/src/pkg/github.com/prasmussen/gdrive/util (from $GOROOT)
        ($GOPATH not set)
drive.go:8:2: cannot find package "github.com/voxelbrain/goptions" in any of:
        /usr/lib/go/src/pkg/github.com/voxelbrain/goptions (from $GOROOT)
        ($GOPATH not set)

Could you help?
This is Debian backported go version go1.3.1 linux/amd64

Upload a folder

It would be great to be able to upload an entire folder at once.

download by type

is it possible to download by type just as you can in the web UI of google drive ?

Space used and space left

Hi, could you add a command to return spaced used, free space, total space of the google drive ?

It would be great to add a check space left before uploading a large file,
or specify a min_free_space=500mb
so an upload doesn't fill all the space left ... because emails will bounce back if no more space.

P.S.
It would be usefull to have all filesize return in bytes with
list -b and info -b

Thanks and great work !

add new request

Hi,
Please add a new feature to delete all files(empty) in the drive instead of delete file one by one.

Thanks for useful script.

Add OCR support

Great tool! Thanks for making this.
Can you add the option to enable OCR on a file upload?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.