How to wget files from Google Drive

Posted onJanuary 7, 2020ByRobin Scott—Leave a comment

Category: G Suite Tutorials

Tags: Google Drive, Linux, WGET

Table of Contents

  • Is my file big or small?
  • The Wget process
    • WGET Command For Small (under 100MB Files)
    • WGET Command For Large (over 100MB Files)
  • Notes

A long time ago, I had occassion to WGET files from WeTransfer to a server after being sent a large file from a client, and being located somewhere with poor broadband.

This happens to us less regularly now, but sometimes you maybe will find yourself in a situation where you want to get a file from Google Drive onto your server, instead of downloading and then uploading the same file – i.e. take a backup straight to your new server, or similar.

Is my file big or small?

The first thing to get your head around is this – for the purposes of the below description, you’ll need to check if your file is big or small.

Small = under 100MB

Big = Over 100MB

As we’re usually talking about large zipped up or gzipped backup files, we’re almost always dealing with Big, here, but your needs may differ. If you use the small file WGET on a large file (of over 100 MB) you’ll find you get a zip file, but it’s empty… not good.

The Wget process

The following steps apply whether you have a large or a small file:

  1. Select the file in Google Drive with right click
  2. Click “Share” – you’ll see a modal open up
  3. Click “Advanced” in the bottom right
  4. Next to “Who has access” press “change”
  5. Select “ON – Public on the web” and hit “save”
  6. This will reveal a link for sharing – copy this full link, and paste into a text editor
  7. You’ll need the part after “https://drive.google.com/file/d/” and before “/view?usp=sharing” for later. This is what we will call “FILE_ID” below
  8. Use the wget command from below, based on your file size, replacing your relevant data for FILE_ID and FILE_NAME

WGET Command For Small (under 100MB Files)

  // Wget command to collect small files from Google Drive added by Robin Scott of silicondales.com
  wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILE_ID' -O FILE_NAME

view rawwgetcomman.txt hosted with ❤ by GitHub

WGET Command For Large (over 100MB Files)

  // Use the below to wget in large files (over 100MB) from Google Drive. Added by Robin Scott of SiliconDales.com. See full instructions at https://silicondales.com/tutorials/g-suite/how-to-wget-files-from-google-drive/
  wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILE_ID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILE_ID" -O FILE_NAME && rm -rf /tmp/cookies.txt

view rawgoogle-drive-large-wget.txt hosted with ❤ by GitHub

使用wget从google drive下载相关推荐

  1. 使用wget从Google Drive下载数据集

    许多用于训练的数据集很大,一般通过Google Drive进行分享,而出于磁盘容量和方便训练的考虑,这些数据我们一般放在服务器上,服务器没有图形界面,因此我们需要使用wget来进行下载. Google ...

  2. [MAC]Google Drive下载大文件

    在使用Chrome从Google Drive下载8G数据集的过程中,多次出现网络错误问题导致下载失败,特在此记录解决方法. 下载前提:已成功翻墙 一.出错原因: Google Drive下载大文件的时 ...

  3. gee批量下载数据Google Drive下载大文件

    目录 Google Earth Engine 申请教程: shp上传 数据下载代码 区域裁剪(裁剪对代码执行效率影响极大) 批量RUN Google Drive下载大文件 Google Drive→M ...

  4. Google Drive下载大文件问题解决办法

            近期一位笨蛋找我帮忙下载一个文件,在Google Driver里,我心想这有什么难的,然鹅,问题真的就莫名其妙出现了.总大小1.8G,chrome直接下载,下载速度5MB/s,预计5分 ...

  5. Kaggle从google drive下载文件的方法

    文章目录 1. 从google drive获取文件ID: 1.1 在google drive中右键点击文件,选择`获取链接` 1.2 在弹窗中复制链接 1.3 修改权限 2. 在kaggle note ...

  6. Google drive下载失败,网络错误

    今天在Google drive上下载数据集,也就1.4G,一直下载失败,网络错误,觉得可能是tizi不稳定,用手机的试着下载,还是老样子,总结下网络上的各种方法: 1.换IE浏览器(各种浏览器都试了下 ...

  7. [已解决] Google Drive 下载文件超出下载限额

    下载一些Google drive上下载大文件或者数据集的时候,我们通常会遇到一个问题就是: 解决的办法其实很简单,就三步: 右键点击文件,添加星标. 在网页左侧的已加星标中,找到文件.右键点击文件复制 ...

  8. google drive下载大文件 无需续传

    搬运:http://baijiahao.baidu.com/s?id=1597912220585159305&wfr=spider&for=pc 步骤: 注册MultCloud账号:h ...

  9. 【Linux】远程下载 Google Drive 文件方法

    问题 现在用 Google Drive 下载链接之后由于有风险警告,所以不能直接远程下载. 解决 用脚本跳过警告,进行下载. 下载脚本 wget https://raw.githubuserconte ...

  10. 如何下载Google Drive中的超大型文件

    本文将对「如何下载Google Drive中的超大型文件?」这一问题展开探索和解决. 太长不看:直接看这里 情景与问题 在AI.系统安全等研究领域,一项研究成果的产生需要大量的数据样本进行训练和分析, ...

最新文章

  1. vue 启动时卡死_使用 Vue 两年后
  2. ucosii事件控制块------消息邮箱与消息队列
  3. jsp mysql 换行_jsp 操作 mysql 数据库
  4. 用户自定义的标识符的一些注意事项
  5. java runtime environment 官网_Java Runtime Environment SE Development Kit
  6. oracle11gr2配置监听,Windows环境配置Oracle 11gR2 Listener
  7. Mysql控制流语句
  8. setValue:forKey of nsobject
  9. Android学习视频精品课程汇总(持续更新)
  10. QT出现“d:\Program Files (x86)\SogouInput\Components\”问题初步想法
  11. 干货,下载网易云课堂和B站的视频
  12. 台式计算机2017排行分析,台式电脑CPU性能排行 桌面CPU天梯图2017年9月最新版 (全文)...
  13. 安装智能陈桥五笔时请小心
  14. 前端性能优化之----静态文件客户端离线缓存_20191110
  15. ArcGIS API For JavaScript官方文档之Dojo
  16. 卸载360天擎企业版
  17. 冬至时节饮食养生要注意“三多三少
  18. 稻城亚丁6日游之第五天(新都桥-丹巴)
  19. Python中range()函数的用法
  20. Java基础知识之封装+继承+多态详解

热门文章

  1. 数字IC四大岗位分析
  2. 深度网络梯度爆炸的原因、产生的影响和解决方法(常用激活函数)
  3. windows系统C盘扩容详解
  4. 《3D数学基础》1.7 向量的向量积
  5. c语言实验作业感想,c语言程序报告实验总结(共10篇).docx
  6. jQuery UI autocomplete
  7. JavaScript的一些简单代码
  8. validation
  9. 2021-2027全球与中国抽屉五金市场情况与未来趋势研究报告
  10. 体系结构复习2——指令级并行(分支预測和VLIW)