How to download files from Google Drive through terminal
Tool
The easiest way that works for me
- pip install gdown
- gdown https://drive.google.com/uc?id=file_id
The file_id should look something like 0B7pQmm-OfDv7SHFadHR4RllfR1E
You can get it by right-clicking on the file and then Get shareable link. Tested on open access files. I’m not sure whether it works for the directory.
Just remove export=download& from gdown https://drive.google.com/uc?export=download&id=your_file_id and It works like a charm.
Trick:
https://drive.google.com/uc?authuser=0&id=0B7pQmm-OfDv7SHFadHR4RllfR1E&export=download
OR
https://drive.google.com/uc?id=0B7pQmm-OfDv7SHFadHR4RllfR1E&export=download
Convert them to
https://drive.google.com/uc?id=0B7pQmm-OfDv7SHFadHR4RllfR1E
For Example:
$ gdown https://drive.google.com/uc?id=0B7pQmm-OfDv7SHFadHR4RllfR1EDownloading...From: https://drive.google.com/uc?id=0B7pQmm-OfDv7SHFadHR4RllfR1ETo: /home/rahul.patel/pointer-generator/pretrained_model_tf1.0.zip194MB [00:05, 32.7MB/s]