Skip to content
forked from wkentaro/gdown

Download a large file from Google Drive (curl/wget fails because of the security notice).

License

Notifications You must be signed in to change notification settings

stevenguyen72/gdown

This branch is 289 commits behind wkentaro/gdown:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

bfecc4a · May 9, 2021
May 4, 2020
Apr 2, 2020
May 2, 2021
Apr 29, 2020
Feb 12, 2020
Feb 12, 2020
May 21, 2017
Jan 2, 2019
Mar 25, 2018
Aug 28, 2019
May 4, 2020
Feb 12, 2020
May 9, 2021
May 2, 2021

Repository files navigation

gdown

Download a large file from Google Drive.


Description

Download a large file from Google Drive.
If you use curl/wget, it fails with a large file because of the security warning from Google Drive.

Installation

pip install gdown

Usage

From Command Line

$ gdown --help
usage: gdown [-h] [-V] [-O OUTPUT] [-q] [--id] [--proxy PROXY] [--speed SPEED]
             [--no-cookies]
             url_or_id
...

$ # a large file (~400MB)
$ gdown https://drive.google.com/uc?id=0B_NiLAzvehC9R2stRmQyM3ZiVjQ
$ # gdown --id 0B_NiLAzvehC9R2stRmQyM3ZiVjQ
$ md5sum pose_estimation_2d_chainermodel.pkl
587933c2c0adf335ebed0486c183541f

$ # a small file
$ gdown https://drive.google.com/uc?id=0B9P1L--7Wd2vU3VUVlFnbTgtS2c
$ cat spam.txt
spam

$ # as an alternative to curl/wget
$ gdown https://httpbin.org/ip -O ip.json
$ cat ip.json
{
  "origin": "126.169.213.247"
}

$ # write stdout and pipe to extract
$ 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'

From Python

import gdown

url = 'https://drive.google.com/uc?id=0B9P1L--7Wd2vNm9zMTJWOGxobkU'
output = '20150428_collected_images.tgz'
gdown.download(url, output, quiet=False)

md5 = 'fa837a88f0c40c513d975104edf3da17'
gdown.cached_download(url, output, md5=md5, postprocess=gdown.extractall)

License

See LICENSE.

About

Download a large file from Google Drive (curl/wget fails because of the security notice).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%