使用命令行从Google Drive直接下载大文件

a63fe017fea88b92d1360970912896a2.png

仓库地址

https://github.com/wkentaro/gdown

安装

pip install gdown

命令行参数

λ gdown --help
usage: gdown [-h] [-V] [-O OUTPUT] [-q] [--fuzzy] [--id] [--proxy PROXY] [--speed SPEED] [--no-cookies] [--no-check-certificate] [--continue] [--folder]
             [--remaining-ok]
             url_or_id

positional arguments:
  url_or_id             url or file/folder id (with --id) to download from

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         display version (default: None)
  -O OUTPUT, --output OUTPUT
                        output file name / path (default: None)
  -q, --quiet           suppress standard output (default: False)
  --fuzzy               (fild only) extract Google Drive's file ID (default: False)
  --id                  flag to specify file/folder id instead of url (default: False)
  --proxy PROXY         <protocol://host:port> download using the specified proxy (default: None)
  --speed SPEED         download speed limit in second (e.g., '10MB' -> 10MB/s) (default: None)
  --no-cookies          don't use cookies in ~/.cache/gdown/cookies.json (default: False)
  --no-check-certificate
                        don't check the server's TLS certificate (default: False)
  --continue, -c        (file only) resume getting a partially-downloaded file (default: False)
  --folder              download entire folder instead of a single file (max 50 files per folder) (default: False)
  --remaining-ok        (folder only) asserts that is ok to download max 50 files per folder. (default: False)

简单示例

gdown https://drive.google.com/uc?id=1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ
# gdown --id 1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ
# 下载Google Drive文件夹
gdown https://drive.google.com/drive/folders/1ivUsJd88C8rl4UpqpxIcdI5YLmRD0Mfj -O /tmp/folder --folder

这篇文章有用吗?

点击星号为它评分!

平均评分 2.6 / 5. 投票数: 5

到目前为止还没有投票!成为第一位评论此文章。

发表评论