What is gdown?
gdown
is a Python package that allows you to download files from Google Drive via the command line. It's lightweight, supports resuming downloads, and is great for automation in scripts.
Prerequisites
Before we begin, ensure you have:
- Python 3.x installed.
- pip installed (Python package manager).
- The Google Drive file link you want to download.
Important:
The file must be shared with “Anyone with the link” access.
Private or restricted files cannot be downloaded using gdown unless they are publicly shared.
Install gdown
Install gdown using pip:
pip install gdown
To install it system-wide (if using sudo):
sudo pip install gdown
Or, if you prefer using pip3:
pip3 install gdown
Get the File ID from Google Drive Link
Get the file ID from your Google Drive share link.
Example link:
https://drive.google.com/file/d/1a2b3c4D5eF6G7h8Ij9KLMnoPqRstuV/view?usp=sharing
The file ID here is:
1a2b3c4D5eF6G7h8Ij9KLMnoPqRstuV
Download the File Using gdown
Using the --id
Flag
Download the file directly from your terminal:
gdown --id 1a2b3c4D5eF6G7h8Ij9KLMnoPqRstuV -O outputFileName
Replace outputFileName
with the desired name for your downloaded file.
This command will fetch the file from Google Drive
Top comments (0)