zeyuyun1
zeyuyun1

Reputation: 143

How to download large file from google drive from terminal? (gdown doesn't work)

This is the extension to this question. All the solution on that post I tired doesn't work for now, unfortunately, since I don't have enough reputation to comment on that post, I can only make a new post about it.

The question is how to download large file using only terminal. An example large file is this

I think the most recent solution is using gdown. Since the id for the file above is 1Vq_UO-T9345uYs8a7zloukGfhDXSDd2A, I tried:

gdown --id 1Vq_UO-T9345uYs8a7zloukGfhDXSDd2A

and I received error message:

        Too many users have viewed or downloaded this file recently. Please
        try accessing the file again later. If the file you are trying to
        access is particularly large or is shared with many people, it may
        take up to 24 hours to be able to view or download the file. If you
        still can't access a file after 24 hours, contact your domain
        administrator. 

The most recent solution suggested on this github discussion page also suggest the same error is received when downloading a huge file, >50gb

Upvotes: 7

Views: 16344

Answers (1)

sjdonado
sjdonado

Reputation: 604

You can try generating an OAuth token

  • Go to OAuth 2.0 Playground https://developers.google.com/oauthplayground/
  • In the Select the Scope box, paste https://www.googleapis.com/auth/drive.readonly
  • Click Authorize APIs and then Exchange authorization code for tokens
  • Copy the Access token
  • Run in terminal
curl -H "Authorization: Bearer ACCESS_TOKEN" https://www.googleapis.com/drive/v3/files/FILE_ID?alt=media -o FILE_NAME 

Upvotes: 33

Related Questions