Welcome to our YouTube Downloader Script! This Python-based tool offers a versatile and efficient way to download videos and playlists from YouTube. Whether you're looking for the highest quality video, or just the audio track, our script has got you covered. Read on to discover its key features, installation process, and how you can configure it for your own use.
- Versatile Download Options: Download individual videos, complete playlists, or batch downloads. Choose between video and audio formats.
- High-Quality Downloads: Fetches the highest available quality for videos and audios.
- Batch Downloading: Supports downloading multiple videos at once, either by entering URLs or reading from a file.
- Integrity Checks: Ensures the integrity of the downloaded files using FFmpeg.
- Logging System: Maintains a detailed log of all download activities for troubleshooting and record-keeping.
- User-Friendly Interface: Simple and interactive prompts guide the user through the download process.
- File Sanitization and Renaming: Automatically handles invalid characters in filenames and provides options for renaming existing files.
- Playlist Support: Download entire playlists or select specific videos from a playlist.
- Automatic Metadata Tagging: Automatically tags downloaded audio files with relevant metadata.
- Retry Mechanism: In case of failures, the script retries downloading the file.
-
Clone the Repository:
git clone https://github.com/tejasholla/YouTube-Downloader.git
-
Install Dependencies:
- Python 3.x or higher is required.
- Install Pytube:
pip install pytube
. - Install tqdm:
pip install tqdm
. - Install tqdm:
pip install mutagen
. - Ensure FFmpeg is installed and added to your system's PATH.
- FFmpeg Path: Set the path to your FFmpeg installation in the script.
- Download Path: Customize the default paths for saving videos and audios.
- Log Directory: Choose a directory for saving log files.
- Run the script using
python ytdownloader.py
. - Follow the interactive prompts to choose your download options and enter URLs.
-
Downloading a Single Video as Audio:
python ytDownloader.py -m single -t audio -u https://www.youtube.com/watch?v=example
-
Downloading a Batch of Videos as Video:
python ytDownloader.py -m batch -t video -u https://www.youtube.com/watch?v=example1 https://www.youtube.com/watch?v=example2
-
Downloading from a File Containing URLs:
python ytDownloader.py -m batch -t video -f path_to_file.txt
-
Specifying a Download Directory:
python ytDownloader.py -m single -t audio -u https://www.youtube.com/watch?v=example -d C:\Users\YourName\Downloads
-
Downloading an Entire Playlist as Audio:
python ytDownloader.py -m single -t audio -p -u https://www.youtube.com/playlis
- Handling Large Playlists: For large playlists, consider downloading in batches to manage bandwidth and storage effectively.
- Custom Metadata: Customize the fetch_metadata function to fetch more detailed metadata from external APIs.
- Error Handling: Check the log files for detailed error messages in case of download failures.
If you find this script useful, please consider starring the repository and contributing with your ideas and improvements. Your feedback and contributions are highly appreciated!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
A big thank you to everyone who contributes to this project, and to all the users and developers who have made Python and its libraries such robust and versatile tools for the community.
This project is licensed under the MIT License. See the LICENSE file for details.
Happy Downloading! 🎉📥
Remember, with great power comes great responsibility. Use these spells wisely, and let the magic unfold!
Note: This script is for educational purposes only. Please adhere to YouTube's terms of service when using this tool.