Youtube Downloader Python Script
This Python script allows you to download all videos from a YouTube playlist or a single video at the highest available quality up to 720p. It is designed to handle large playlists, skip already downloaded videos, and maintain logs for each session.
- Download Playlists or Single Videos: Supports both YouTube playlists and individual video URLs.
- Skip Duplicate Downloads: Checks if a video has already been downloaded before attempting to download it again.
- Threaded Processing: Runs the download process in a separate thread to avoid blocking the main program.
- Logs: Generates a timestamped log file for each session, detailing the progress and errors encountered.
This script requires the following Python packages:
yt-dlp
threading
datetime
os
Install dependencies using pip:
pip install yt-dlp
- Clone this repository:
git clone https://github.com/kevinomyonga/yt-downloader-script
- Navigate to the project directory:
cd yt-downloader-script
- Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
Run the script as follows:
python yt_downloader.py
When prompted:
- Enter a YouTube playlist URL to download all videos in the playlist.
- Enter a single YouTube video URL to download only that video.
- Videos will be downloaded to the
downloads
directory. - A log file for the session will be saved in the
logs
directory with a timestamped name, e.g.,logs/log_20241125_143200.txt
.
This project is licensed under the terms of the LICENSE file in this repository. Please review the license for usage guidelines.
Kevin Omyonga
Website | Twitter
Contributions are welcome! If you encounter any issues or have ideas for improvements, feel free to open an issue or submit a pull request.
This project uses the yt-dlp library for downloading videos from YouTube.
If you like this project, consider supporting its development: