使用Python从Google Drive下载文件

发布于 2025-01-30 10:52:59 字数 299 浏览 3 评论 0原文

我想直接使用Python从Google Drive下载文件。我尝试了许多模块,例如Pydrive,Google Drive API,GDown,GoogledriveFileDownLoader等等,但总是会给我带来错误。当我使用GDown模块下载任何类型的文件时,它的工作正常完美,但是当我打开下载文件时,不支持其显示文件。

我尝试了此代码,如以下

这是遵循代码和输出

I want to download file from google drive directly using python. I had tried many module's like pydrive, google drive API, gdown, googledrivefiledownloader and many more but it always throw me error. When i use gdown module to download any type of file it's work perfectly but when i open that downloaded file it's show file is not supported.

I had tried this code as following

This is following code and output

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽手叙旧 2025-02-06 10:52:59

尝试此代码: -

from zdrive import Downloader

output_directory = "/home/abhinav/Documents"
d = Downloader()

# folder which want to download from Drive
folder_id = 'XXXX-YYYY-ZZZZ'
d.downloadFolder(folder_id, destinationFolder=output_directory)

Try this code:-

from zdrive import Downloader

output_directory = "/home/abhinav/Documents"
d = Downloader()

# folder which want to download from Drive
folder_id = 'XXXX-YYYY-ZZZZ'
d.downloadFolder(folder_id, destinationFolder=output_directory)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文