A Python script to download files from a given URL and save them to Google Drive. "url-to-google-drive" is a Python script for Google Colab that simplifies downloading files from URLs and saving them to Google Drive.
This script is designed to be used in a Google Colab environment. You can simply copy and paste the code into a new Colab notebook.
Use the following code to mount your Google Drive to the Colab notebook:
from google.colab import drive
drive.mount('/content/drive')
Verify the mount by running
ls "/content/drive/My Drive/"
Specify the file path where you want to save the downloaded file:
data_path = 'datasets'
Provide the URL of the file you want to download:
url = "https://example.com/file.zip"
Call the save_to_drive
function with the URL and file path:
save_to_drive(url, f"{data_path}/file.zip")
- Google Colab environment
tqdm
library (installed by default in Colab)
Contributions are welcome! If you'd like to contribute to this project, please fork the repository and submit a pull request.
[@mausam-giri]