3

I was just given a large list of 500mb files in google drive. How would I go about queuing them for download on my local Linux machine?

I can't zip them all as a large download

I can't set them all to download at once

I can't be here all day to download them in small batches.

I see from documentation like wget/curl large file from google drive that the the api is depreciated from google drive and that we can't wget them.

So what I am looking for a way for sequentially download large files from a google drive, without having to manually click through the web browser to do so.

Community
  • 1
  • 1
Bryce Drew
  • 5,777
  • 1
  • 15
  • 27
  • 1
    Haven't you tried other given responses from your given SO post like the use of open source Linux/Unix command line tool [gdrive](https://github.com/prasmussen/gdrive)? – Teyam May 10 '16 at 10:52
  • I don't understand that sentence, but I looked at gdrive and it is exactly what I need. Thanks. I posted an answer describing how I solved my issues. – Bryce Drew May 10 '16 at 16:50

3 Answers3

11
  1. Go to OAuth 2.0 Playground
  2. In Select & authorize APIs(Step 1), Select “Drive API v3” and then select "https://www.googleapis.com/auth/drive.readonly" as the scope.
  3. Authorize the API using Google ID and exchange authorization code for tokens(Step 2). We will get the access token and refresh token
  4. Open terminal and run

curl -H "Authorization: Bearer XXXXX" https://www.googleapis.com/drive/v3/files/YYYYY?alt=media -o ZZZZZ

where

XXXXX===> Access Token

YYYYY===> File ID

ZZZZZ===> File Name that will be saved

5. Tested on Linux ( Should also work on Mac ). Windows can try with PowerShell.

Reference: Drive REST API Documentation.

Vivek Aditya
  • 1,145
  • 17
  • 46
Joseph Varghese
  • 589
  • 5
  • 16
1

I am going to explain how I solved my issue:

Use https://github.com/prasmussen/gdrive set it up as per the instructions on the page. It is not depreciated at this time, like my original misconception.

Right click on files. Get shareable link. (gdrive list doesn't work in this case, as it is not in your drive, but someone else’s. Could look into copying it over to your repo, and getting the list from there.)

Paste all the links into a plain-text file, and then remove https://drive.google.com/open?id= from the start of all the links.

Then you can sequentially download the list of google drive files with the following command: while read p; do ./gdrive download $p; done <files.txt

Bryce Drew
  • 5,777
  • 1
  • 15
  • 27
0

Google Drive Sync helped me with this. Either you can install the sync and download or sync all files to local pc.

Or

Create a new drive and share to the files required to this drive, then sync this drive to local pc using google drive sync.

Arun Prasad E S
  • 9,489
  • 8
  • 74
  • 87