zoukankan      html  css  js  c++  java
  • [备忘录]Download Google Drive Files using wget

    Files can be downloaded from google drive using wget. Before that you need to know that files are small and large sized in google drive.

    Files less than 100MB are regarded as small files where as files greater than 100MB are regarded as large files.

    Before the file to be downloaded it is needed to be share publicly.

    Steps:

    1. Select a file that is need to be downloaded and do right click.
    2. Click Share. A dialog box will appear.
    3. Click Advance in the right bottom corner.
    4. Click on the Change.. under who has access.
    5. Make it On- Public on the web.
    6. Click Save button.
    7. Copy the link for sharing…like…https://drive.google.com/file/d/1UibyVC_C2hoT_XEw15gPEwPW4yFyJFeOEA/view?usp=sharing
    8. Extrac FILEID part like….from above….1UibyVC_C2hoT_XEw15gPEwPW4yFyJFeOEA

    SO for small file run following command on your terminal:

    wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME
    

    In the above command change the FILEID by above id extracted and rename FILENAME for your own simple use.

    For large file run the following command with necessary changes in FILEID and FILENAME:

    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=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/1
    /p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt
    

      

    In the above command change the FILEID by above id extracted and rename FILENAME for your own simple use.

    For lagre file run the following command with necessary changes in FILEID and FILENAME:

  • 相关阅读:
    ListView 分页显示(转载+修改)下
    ListView 分页显示(转载+修改)上
    Android_开发片段(Part 1)
    JSCH执行linux命令
    linux运行wkhtmltopdf
    Apache HttpClient
    JDK自带的URLConnection
    java poi读取excel
    CXF webservice完整例子
    Oracle 常用初始化命令
  • 原文地址:https://www.cnblogs.com/xiaoaoran/p/12312369.html
Copyright © 2011-2022 走看看