Code Monkey home page Code Monkey logo

google-drive-downloader's Introduction

Google-Drive-Downloader

Download any files directly to the google drive. It uses Google Colab to download files. If you need to save the files from some website to drive then you have to download it and then uplaod it. This becomes very difficult when the file size is too large. This method solves the issue by directly downloading the file to drive, also at very high speed.

Setup:

  • Open Google Colab.
  • Create a new notebook.
  • Connect to the Drive and create a mount point. For that, authentication is required.
    from google.colab import drive
    drive.mount('/content/drive', force_remount = True)
    For authentication, choose an account to link then allow access to the Drive. It will generate the auth key, which needs to be entered in the Colab notebook. demo
  • Use Linux bash commands to create a folder in our Drive. Colab or Jupyter notebook can run all the bash commands directly through the notebook. The below code will create a folder "Download" in the root directory of Drive. Remember not to change "My Drive", it is the root directory of Google Drive.
    !mkdir "/content/drive/My Drive/Download"
  • Use wget command to download the file to Download folder.
    !wget -O '/content/drive/My Drive/Download/img1.jpg' "https://unsplash.com/photos/u159a2eL6UE/download?force=true"
    general syntax to download:
    !wget -O '/content/drive/My Drive/Download/file_name.ext' "download_url"
    where file_name.ext is the required name of the file and .ext represent the respective extention. Example:
    Img.jpg 
    my_pic.png
    software.exe
    my_collection.zip
    
    and replace download_url with the url of the file.

Note: If you can get a download link, which is in most of the cases, you will able to download the file. But sometime it may be challenging to get the download link.

Example

In this repo, find downloader.ipynb as an example notebook. You can check more details of wget command here.

google-drive-downloader's People

Contributors

tarunk04 avatar

Stargazers

Peter Abbasi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.