This README provides an overview and usage instructions for the code included in this repository.
The code in this repository is designed to facilitate the downloading of files from various sources, including YouTube videos and other URLs. It leverages the tqdm
, requests
, pytube
, and os
libraries to achieve this functionality.
To run the code, please ensure that you have the following prerequisites installed:
- Python 3.x
- The
tqdm
,requests
,pytube
, andos
libraries
- Clone the repository to your local machine.
- Open the code in a Python editor or IDE.
- Mount your Google Drive by running
drive.mount('/content/drive')
. - Define the destination folder in your Google Drive where the downloaded files will be saved. Modify the
destination_folder
variable to specify the desired folder path. - If the destination folder doesn't exist, the code will create it automatically.
- Use the
download_youtube_video()
function to download YouTube videos. Pass the YouTube video URL and the destination folder path as arguments to the function. - If the input is not a YouTube link, the code will attempt to download the file from the provided URL. Make sure the URL is accessible and the file exists.
- The code will display the file size and progress bar while downloading the file.
- Once the file is downloaded, it will be saved in the specified destination folder.
- Repeat the process for downloading additional files by entering new URLs or YouTube links.
- To exit the program, enter 'exit' when prompted for a download link.
Here is an example usage of the code:
- Mount your Google Drive:
drive.mount('/content/drive')
- Define the destination folder in your Google Drive:
destination_folder = '/content/drive/MyDrive/DOWNLOADS 02/'
- Run the code and follow the prompts to enter a download link or YouTube URL. For example:
Enter the download link (or 'exit' to quit): https://www.youtube.com/watch?v=abcde12345
- Monitor the progress bar as the file downloads. Once completed, the file will be saved in the specified destination folder.
- Ensure that you have a stable internet connection while running the code, especially when downloading large files or streaming YouTube videos.
- Please be aware of any legal restrictions or copyright issues when downloading files from external sources.
Contributions to this repository are welcome. If you find any issues or have suggestions for improvements, please submit a pull request or open an issue.
This code is released under the MIT License.
- The
tqdm
library: https://github.com/tqdm/tqdm - The
requests
library: https://github.com/psf/requests - The
pytube
library: https://github.com/nficano/pytube - Google Colaboratory: https://colab.research.google.com/