Skip to content

DG02002/gdrivedl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gdrivedl

You can download Google Drive files and folders from the command line using the Google Drive Downloader with aria2 (gdrivedl).

gdrivedl demo

Features

  • Using token.pickle to access Google Drive APIs.
  • Download the Folder on Local as it was structured on Google Drive.
  • Resuming partially downloaded files
  • Skipping Existing files

Requirement

  • python
  • Then install these librarys
pip install google-auth-oauthlib google-auth google-auth-httplib2 google-api-python-client

Documentation

Note

Using your own account OAuth 2.0 Client is always preferable. You can also use rclone OAuth 2.0 Client, but it frequently returns the "Rate Limit Exceeded" error.

Create Your Own Account OAuth 2.0 Client IDs to access Google Drive API

  1. Create a Google Cloud project
  2. Enable Google Drive API
  3. Configure OAuth consent & Publish your app (to prevent the token from expiring after 7 days), Make sure that you do not select any scopes for your app. It allows you to publish your app instantly.
  4. Create access credentials Create OAuth client ID credentials Click Create Credentials > OAuth client ID. Click Application type > Desktop app.
  5. Download your OAuth client ID credentials.

Detailed Guides

Usage

Make sure to change Default download location the in the gdrivedl.py file. https://github.com/dg0072/gdrivedl/blob/fdc7cf1963eef959467e161a72110c01720d857e/gdrivedl.py#L16

gdrivedl -h
usage: gdrivedl.py [-h] [--auth OAuth_client] [--limit Speed_Limit] [link]

Google Drive Downloader with aria2 integration.

positional arguments:
  link                 Google Drive Link

options:
  -h, --help           show this help message and exit
  --auth OAuth_client  Set up OAuth 2.0 client_secret to Access Google Drive APIs
  --limit Speed_Limit  Set download speed limit (Example: 500K, 10M)

Examples

  • Using OAuth 2.0 client_secrets credentials to access Google Drive API
python gdrivedl.py --auth "path/client_secrets.json"
  • To Download files or folders
python gdrivedl.py "Link"
  • Download files or folders with speed limit
python gdrivedl.py "Link" --limit 10M

Credit