Skip to content

Download any file to your Google Drive without wasting your time and data connection

Notifications You must be signed in to change notification settings

itskhawer/DownloadToGoogleDrive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Download To Google Drive

This Python project is designed for users working with Google Colab or users that want a tool to simply save a file that is on the internet to their Google Drive. This tool simplifies the process of downloading files from URLs directly to a designated folder in Google Drive.

Features

  • Easy File Download: Downloads files from a given URL using the requests library.
  • Progress Monitoring: Displays a progress bar during the download process using tqdm.
  • Seamless Integration with Google Drive: Automatically moves the downloaded files to a specified folder in Google Drive.
  • Error Handling: Robust error handling for download and file movement operations.

Prerequisites

  1. A Google account with Google Drive access.
  2. Google Colab environment.

How to Use

1. Clone the Repository

Clone the repository in your working directory:

!git clone https://github.com/itskhawer/DownloadToGoogleDrive.git

2. Mount Google Drive

Before running the script, ensure your Google Drive is mounted:

from google.colab import drive
drive.mount('/content/drive')

3. Run the Script

  1. Open the script in Google Colab.
  2. Execute the main() function.
  3. Provide the URL of the file you want to download when prompted.

4. File Storage

  • Files are temporarily saved in the Colab environment before being moved to the folder /MyDrive/Download in your Google Drive.

Code Overview

Main Functions

  1. download_file(url, temp_save_path)

    • Downloads a file from the specified URL to a temporary location.
    • Displays a progress bar during the download.
  2. move_file(temp_save_path, final_save_path)

    • Moves the downloaded file from the temporary location to the final destination in Google Drive.
  3. main()

    • Orchestrates the process of file download and movement.

Directory Structure

DownloadToGoogleDrive/
│
├── download_to_google_drive.py  # Main script

Example Usage

  1. Input the file URL when prompted:
    Enter the URL of the file to download: https://example.com/file.zip
    
  2. The script will:
    • Download the file.
    • Save it to /MyDrive/Download in your Google Drive.

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

Contact

For questions or feedback, please reach out to itskhawer.

About

Download any file to your Google Drive without wasting your time and data connection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published