ข้ามไปยังเนื้อหาหลัก

How to directly download files from Dropbox, or Google drive using wget in Terminal or in Google Colaboratory.

· อ่าน 3 นาที
Kobkrit Viriyayudhakorn
CEO, iApp Technology

How to directly download files from Dropbox, or Google drive using wget in Terminal or in Google Colaboratory.

Google Colaboratory is a great tool for data science and machine learning practitioners nowsday. Since a Google Colaboratory is a GPU-enable remote compute instance running on Google Cloud. It does not locally run on our machine. It is quite difficult to upload the dataset or any CSV files into the remote instance.

The easiest way to do is, we upload our files to the Public folder in the Dropbox. We copy the public link and download it using command as follow.

# Dropbox

# Dropbox


## Google Colaboratory


!wget -O news.csv <https://www.dropbox.com/s/XXXXXXX/news.csv?dl=0>


## Terminal, Command Line


$ wget -O news.csv <https://www.dropbox.com/s/XXXXXXX/news.csv?dl=0>

# Google Drive

Unfortunately, in Google drive is not easy like in the Dropbox, the Google drive does not provide direct public link that allow us to fetch the file directly. When you turn on the Link Sharing, They usually provide us the virtual path like this.

[https://drive.google.com/open?id=XXXXXXXXXXXXX](<https://drive.google.com/open?id=1opkctEFmJ8E08PRzaiqNrEyUZcbXegsJ>)XXXXXXXXXXX

Since our team using Google drive as the primary source of file sharing, we need to think the solution for it.

Luckily there is a tool called Gdown (https://github.com/circulosmeos/gdown.pl). You can install via pip. It can directly download file from the Google drive virtual path for us, we can use in the command as follows.

# Google Drive


## Google Colabratory


!gdown --id XXXXXXXXXXXXXXXXX


## Terminal, Command Line


$ pip install gdown


$ gdown --id XXXXXXXXXXXXXXXXX

Note that you need to extract the “XXXXXXXXXXXX” part from the virtual link provided from Google drive by yourself.

Does this blog article helpful?? If yes, please help us press a Clap hand button and press a purple Follow button for getting helpful tips on Artificial Intelligence, Data Science, Machine Learning and Computer Science from iApp Technologyand kobkrit.com

For those whoever want to develop and get consult on creating your own AI model, please getting more information at our company website “iApp Technology” (https://iapp.co.th) and testing our AI demoes (https://ai.iapp.co.th). You can contact me directly at kobkrit@iapp.co.th. Thank you very much. #iApp #Ai

See more at https://iapp.co.th and https://ai.iapp.co.th


How to directly download files from Dropbox, or Google drive using wget in Terminal or in Google… was originally published in Kobkrit on Medium, where people are continuing the conversation by highlighting and responding to this story.