[英]How to download a google drive folder using link in linux
I have a shared google drive folder link(Anyone on the internet with this link can view) as below Ex: https://drive.google.com/drive/folders/1i_c8LhSLf-LttV-UOMDcY4rLAalxxxx?usp=sharing我有一个共享的谷歌驱动器文件夹链接(互联网上任何人都可以通过此链接查看)如下示例: https://drive.google.com/drive/folders/1i_c8LhSLf-LttV-UOMDcY4rLAalxxxx?usp=sharing
I want to download using any of the wget/CURL/any python packages.我想使用任何 wget/CURL/any python 包下载。
I have tried the below and it doesn't work.我已经尝试了以下方法,但它不起作用。
curl -L "https://drive.google.com/uc?id=1i_c8LhSLf-LttV-UOMDcY4rLAalkcayn&export=download" > test.tar.gz
import gdown
import time
url='https://drive.google.com/uc?id=1i_c8LhSLf-LttV-UOMDcY4rLAalkxxxx'
output='/data/test/test.zip'
time.sleep(100)
gdown.download(url, output, quiet=False)
Error:错误:
Permission denied: https://drive.google.com/uc?id=1i_c8LhSLf-LttV-UOMDcY4rLAalkcayn
Maybe you need to change permission over 'Anyone with the link'?
The below command worked for files but not for folders以下命令适用于文件但不适用于文件夹
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=11e85AnMEGEjrxPuewlmeg-ABOZ8asdf' -O test
Thanks for your help in advance!提前感谢您的帮助!
gdown is a great application to download single file from gdrive with only file id or link required, but there were several great minds of github who were inspired to implement a folder download functionality. gdown是一个很棒的应用程序,可以从 gdrive 下载单个文件,只需要文件 id 或链接,但是github 的一些伟大思想受到启发,实现了文件夹下载功能。
Actually, state of this feature can be viewed in gdown:90 github PR .实际上,此功能的 state 可以在gdown:90 github PR中查看。
You can use it, since it is implemented almost perfectly (there is an issue of only 50 files in folder as maximum to download):您可以使用它,因为它实现得几乎完美(存在一个问题,即文件夹中最多只有 50 个文件可供下载):
folder_download
feature via pip:通过 pip 安装带有开发folder_download
功能的 gdown:pip install git+https://github.com/giuliano-oliveira/gdown_folder.git
gdown.download_folder
function in python3 shell (since cli support for folder download is not implemented):现在我们需要在 python3 shell 中运行gdown.download_folder
function (因为没有实现对文件夹下载的 cli 支持): $ python3
import gdown
gdown.download_folder(gdrive_folder_link, quiet=True)
Use your own gdrive_folder_link
in format https://drive.google.com/drive/u/1/folders/{id}
(others weren't checked).使用您自己的gdrive_folder_link
格式https://drive.google.com/drive/u/1/folders/{id}
(其他未检查)。
Note:笔记:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.