The easiest way to download files from the internet directly to Google Drive


When you have to store a large file on Google Drive, you don’t want to download the file to your local computer for uploading to Google Drive. You can download a file directly to Google Drive via Google Colab. I’m going to show how to do it.

First, go to Google Colab and create a new .ipynb notebook. Copy and paste the following code to a cell.

from google.colab import drive

Click the URL next to Go to this URL in a browser: and copy your authorization code. Go back to the notebook page and paste the authorization code. Now you have mounted your Google Drive storage in Google Colab, so you can download a file directly to Google Drive using wget.

In the example below, I will download the file and copy the file to Google Drive.

!cp gdrive/My\ Drive/

You can check if your file is stored in your Google Drive like this.

ls gdrive/My\ Drive/


Copied title and URL