【发布时间】:2022-01-11 20:26:28
【问题描述】:
我在 Google Drive 上有一个目录 (temp0),其中包含 100,000 个小文件。我无法在 Google colab 中打开它,大概是因为文件太多。 所以我使用 python tarfile 创建了一个 temp0.tar.gz 文件,它是 489KB,我想从我的 Google Drive 下载它并在 Colab 环境中解压它。 我用过:
!wget -O temp0.tar.gz https://drive.google.com/open?id=1lmGFLXtkvhucF033MmBW9yNiAaEgk4_d&authuser=alantjohnstone%40gmail.com&usp=drive_fs
它似乎工作报告:
Resolving drive.google.com (drive.google.com)... 74.125.31.113, 74.125.31.102, 74.125.31.138, ...
Connecting to drive.google.com (drive.google.com)|74.125.31.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://accounts.google.com/ServiceLogin?service=wise&passive=1209600&continue=https://drive.google.com/open?id%3D1lmGFLXtkvhucF033MmBW9yNiAaEgk4_d&followup=https://drive.google.com/open?id%3D1lmGFLXtkvhucF033MmBW9yNiAaEgk4_d [following]
--2021-12-06 16:14:13-- https://accounts.google.com/ServiceLogin?service=wise&passive=1209600&continue=https://drive.google.com/open?id%3D1lmGFLXtkvhucF033MmBW9yNiAaEgk4_d&followup=https://drive.google.com/open?id%3D1lmGFLXtkvhucF033MmBW9yNiAaEgk4_d
Resolving accounts.google.com (accounts.google.com)... 64.233.170.84, 2607:f8b0:400c:c07::54
Connecting to accounts.google.com (accounts.google.com)|64.233.170.84|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘temp0.tar.gz’
temp0.tar.gz [ <=> ] 89.18K --.-KB/s in 0.001s
2021-12-06 16:14:13 (60.9 MB/s) - ‘temp0.tar.gz’ saved [91323]
但是它只下载了 489K 中的 90K 我无法打开结果以查看它实际上是什么。 有人能告诉我我做错了什么吗?
【问题讨论】:
-
这和 Python 有什么关系?除此之外,查看
wget的输出——它正在下载text/html类型的数据。尝试将下载的tar.gz文件重命名为something.html并在浏览器中查看。
标签: google-drive-api google-colaboratory