使用wget命令下载Google drive上的文件_ubuntu上wget下载谷歌云盘文件-CSDN博客
如何用命令行下载Google Drive上的共享文件?-腾讯云开发者社区-腾讯云
举例:https://drive.google.com/drive/folders/1vKj3VvJEKgS_o-uOSmz3I0-GomECpql3
1、在网页上,按F12进入开发者模式,选择网络(network)。
2、单击要下载的文件,然后右键点击下载,这个时候会有提示框出现,继续点击 仍然下载
3、找到网络
最后出现的一行,注意要由类似 download?id=你的ID..
这样的信息,然后右键,选择复制cURL(bash)命令,这样你就复制了谷歌官方提供的下载命令了。
注意:如果ur?id复制完下载不了,可以尝试其他的cUrl下载一下。
比如这个页面试了一个1ov开头的链接,才是正确的下载链接:
以下是我复制得到的命令:
curl 'https://drive.usercontent.google.com/download?id=17wXe-QtBIvnmzWyeBec2Gz6Q_lt9zC4z&export=download&authuser=0&confirm=t&uuid=12f95811-0c0a-4783-abd0-bfc248059a6f&at=APZUnTUl8tMJ74i450boWs2pzTHs:1701927902730' \-H 'authority: drive.usercontent.google.com' \-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \-H 'accept-language: zh-CN,zh;q=0.9,vi;q=0.8' \-H 'cookie: SID=dwjjDsED6IY2_glpXDptbp5E5KQ6A_cDVgxX-vzGBe661DJJoHKGlkNg2W1eXFhjmTH_xA.; __Secure-1PSID=dwjjDsED6IY2_glpXDptbp5E5KQ6A_cDVgxX-vzGBe661DJJKdY3z9heru0SW6eqQn2G-A.; __Secure-3PSID=dwjjDsED6IY2_glpXDptbp5E5KQ6A_cDVgxX-vzGBe661DJJgk3VDvesZ0exz5E1Mi_3Hg.; HSID=A0Um_9GJL0XaXXpII; SSID=ADsNb7s01uOapkoIa; APISID=Ow3MXkErGsasEjJG/ACB3uNEpciCPxzdnM; SAPISID=ttVokEtot5SbIUP8/Aj16RxRyGMa9b8-EZ; __Secure-1PAPISID=ttVokEtot5SbIUP8/Aj16RxRyGMa9b8-EZ; __Secure-3PAPISID=ttVokEtot5SbIUP8/Aj16RxRyGMa9b8-EZ; SEARCH_SAMESITE=CgQI75kB; AEC=Ackid1Qoie4EFh-l50PyWjsb-PM_FKg-81QH545db6pnip5P6d_cs16L8Gc; 1P_JAR=2023-12-07-03; NID=511=hnC18f1zaWboe2OjKdHEHQ5yfaFfYiJymH_8qKmo5UGzUTNPl_oideBGFM73IFnEpZ4XxT3lWUgfeN0aluKx4DshOMSC4L43FP57eUVjEkcHUd2U7f2sgEMSsalD5Hht7LtXVoyRoK1immK8DycyOr3zl2IwtIYoHqtVPUqA4PI_dHediZV7i4jmxLuUZN3Npf3iaS0ZDOcgHBtHlIIPsYwHMoIGPxVmqbcpEa1Y7U8dwiekdEtTPkOS2JbOvV57Qcjg0CVkmR_QrylZ4rdy0MOMErm3AjqHqRy5NjC2iZWzLNB3YuDYSTwQmfTgyMDxfOzJM3m5_-lan2sTirvuUsHcQnGZ; SIDCC=ACA-OxO6SImrO_lM3qOJZMHsOinPzWfScfMei9xuhcXAn_TZHUkiMKGpiu3eFZ366jZmAvuCbBo; __Secure-1PSIDCC=ACA-OxNxcRwetUO3ZYNSC56IgEg3SK6zzIBytI53z9pGRHVRRp6ct6JfndxAOt2FrO46HNxB_pE; __Secure-3PSIDCC=ACA-OxOzQBPckcMWyT07LLfIno4ar6__ZaBjsYYkQq6ITMGVughVXPdd_DrcA4urKmBeqz3niQ' \-H 'sec-ch-ua: "Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"' \-H 'sec-ch-ua-mobile: ?0' \-H 'sec-ch-ua-platform: "macOS"' \-H 'sec-fetch-dest: iframe' \-H 'sec-fetch-mode: navigate' \-H 'sec-fetch-site: same-site' \-H 'upgrade-insecure-requests: 1' \-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36' \-H 'x-client-data: CJ2HywE=' \--compressed
4、下载
复制的命令 -o filename
curl 'https://drive.usercontent.google.com/download?id=17wXe-QtBIvnmzWyeBec2Gz6Q_lt9zC4z&export=download&authuser=0&confirm=t&uuid=12f95811-0c0a-4783-abd0-bfc248059a6f&at=APZUnTUl8tMJ74i450boWs2pzTHs:1701927902730' \-H 'authority: drive.usercontent.google.com' \-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \-H 'accept-language: zh-CN,zh;q=0.9,vi;q=0.8' \-H 'cookie: SID=dwjjDsED6IY2_glpXDptbp5E5KQ6A_cDVgxX-vzGBe661DJJoHKGlkNg2W1eXFhjmTH_xA.; __Secure-1PSID=dwjjDsED6IY2_glpXDptbp5E5KQ6A_cDVgxX-vzGBe661DJJKdY3z9heru0SW6eqQn2G-A.; __Secure-3PSID=dwjjDsED6IY2_glpXDptbp5E5KQ6A_cDVgxX-vzGBe661DJJgk3VDvesZ0exz5E1Mi_3Hg.; HSID=A0Um_9GJL0XaXXpII; SSID=ADsNb7s01uOapkoIa; APISID=Ow3MXkErGsasEjJG/ACB3uNEpciCPxzdnM; SAPISID=ttVokEtot5SbIUP8/Aj16RxRyGMa9b8-EZ; __Secure-1PAPISID=ttVokEtot5SbIUP8/Aj16RxRyGMa9b8-EZ; __Secure-3PAPISID=ttVokEtot5SbIUP8/Aj16RxRyGMa9b8-EZ; SEARCH_SAMESITE=CgQI75kB; AEC=Ackid1Qoie4EFh-l50PyWjsb-PM_FKg-81QH545db6pnip5P6d_cs16L8Gc; 1P_JAR=2023-12-07-03; NID=511=hnC18f1zaWboe2OjKdHEHQ5yfaFfYiJymH_8qKmo5UGzUTNPl_oideBGFM73IFnEpZ4XxT3lWUgfeN0aluKx4DshOMSC4L43FP57eUVjEkcHUd2U7f2sgEMSsalD5Hht7LtXVoyRoK1immK8DycyOr3zl2IwtIYoHqtVPUqA4PI_dHediZV7i4jmxLuUZN3Npf3iaS0ZDOcgHBtHlIIPsYwHMoIGPxVmqbcpEa1Y7U8dwiekdEtTPkOS2JbOvV57Qcjg0CVkmR_QrylZ4rdy0MOMErm3AjqHqRy5NjC2iZWzLNB3YuDYSTwQmfTgyMDxfOzJM3m5_-lan2sTirvuUsHcQnGZ; SIDCC=ACA-OxO6SImrO_lM3qOJZMHsOinPzWfScfMei9xuhcXAn_TZHUkiMKGpiu3eFZ366jZmAvuCbBo; __Secure-1PSIDCC=ACA-OxNxcRwetUO3ZYNSC56IgEg3SK6zzIBytI53z9pGRHVRRp6ct6JfndxAOt2FrO46HNxB_pE; __Secure-3PSIDCC=ACA-OxOzQBPckcMWyT07LLfIno4ar6__ZaBjsYYkQq6ITMGVughVXPdd_DrcA4urKmBeqz3niQ' \-H 'sec-ch-ua: "Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"' \-H 'sec-ch-ua-mobile: ?0' \-H 'sec-ch-ua-platform: "macOS"' \-H 'sec-fetch-dest: iframe' \-H 'sec-fetch-mode: navigate' \-H 'sec-fetch-site: same-site' \-H 'upgrade-insecure-requests: 1' \-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36' \-H 'x-client-data: CJ2HywE=' \--compressed -o ru_om1000a.x1_.xz
fileid=uc?id=17wXe-QtBIvnmzWyeBec2Gz6Q_lt9zC4z
filename=ru_om1000a.x1_.xz