Google Drive is Google’s cloud storage service used by many people to store their data. If you use Google Drive on Windows or Linux Desktop, it’s not worth mentioning, because you can download files from Google Drive to your computer using the browser. But what if you use Linux Server, only command line interface? I tried wget command to download google drive but it didn’t work. Fortunately, on Python, there is a tool called gdown that helps you download Download Google Drive using Terminal.
Join the channel Telegram of the AnonyViet 👉 Link 👈 |
Use gdown to Download Google Drive using Terminal on Linux and Windows
gdown written on python, so on Linux or Windows with Python installed, you will be able to use this tool. With many gdown parameters to help you easily download files from Google Drive with a single command line. This tool helps you to download large files from Google Drive using the command line interface. If you’ve ever tried curl or wget failed because of Google’s security features, try using Gdown.
To use it, do the following:
Install pip for python:
Centos/Rhel: yum -y install python-pip
Debian/Ubuntu/Kali Linux….): apt install python3-pip
Install gdown:
pip install gdown
How to use gdown
Gdown’s parameters:
$ usage: gdown [-h] [-V] [-O OUTPUT] [-q] [--id] [--proxy PROXY] [--speed SPEED] url_or_id $ # dùng gdown tương tự nhưu curl/wget $ gdown https://httpbin.org/ip -O ip.json $ cat ip.json { "origin": "126.169.213.247" } $ # Downlad xong tự giải nén $ gdown https://drive.google.com/uc?id=0B9P1L--7Wd2vNm9zMTJWOGxobkU -O - --quiet | tar zxvf - $ ls 20150428_collected_images/ $ # it can handle urls created from [Share] -> [Copy Url] on Google Drive $ gdown 'https://drive.google.com/a/jsk.imi.i.u-tokyo.ac.jp/uc?id=0B_NiLAzvehC9R2stRmQyM3ZiVjQ'
To download files from Google Drive, you need to get the public link of that file.
Eg: https://drive.google.com/uc?id=0B_NiLAzvehC9R2stRmQyM3ZiVjQ
Then use the command:
gdown https://drive.google.com/uc?id=0B_NiLAzvehC9R2stRmQyM3ZiVjQ
You can use gdown on windows cmd or linux termail, as long as python is installed.