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.
- 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.
- A Google account with Google Drive access.
- Google Colab environment.
Clone the repository in your working directory:
!git clone https://github.com/itskhawer/DownloadToGoogleDrive.git
Before running the script, ensure your Google Drive is mounted:
from google.colab import drive
drive.mount('/content/drive')
- Open the script in Google Colab.
- Execute the
main()
function. - Provide the URL of the file you want to download when prompted.
- Files are temporarily saved in the Colab environment before being moved to the folder
/MyDrive/Download
in your Google Drive.
-
download_file(url, temp_save_path)
- Downloads a file from the specified URL to a temporary location.
- Displays a progress bar during the download.
-
move_file(temp_save_path, final_save_path)
- Moves the downloaded file from the temporary location to the final destination in Google Drive.
-
main()
- Orchestrates the process of file download and movement.
DownloadToGoogleDrive/
│
├── download_to_google_drive.py # Main script
- Input the file URL when prompted:
Enter the URL of the file to download: https://example.com/file.zip
- The script will:
- Download the file.
- Save it to
/MyDrive/Download
in your Google Drive.
Contributions are welcome! Feel free to open an issue or submit a pull request.
For questions or feedback, please reach out to itskhawer.