A powerful and efficient tool to download private YouTube videos using yt-dlp
, complete with file selection dialogs for cookies, video links, and the download location. The script is designed to help users download videos from private YouTube accounts that they have access to, with ease and reliability.
- Flexible Authentication:
- Select the
cookies.txt
file for seamless authentication.
- Select the
- Batch Video Downloads:
- Input a
video_links.txt
file containing YouTube video URLs.
- Input a
- Custom Download Location:
- Choose a directory to save your videos.
- Progress Visualization:
- Displays a real-time progress bar for each download using
tqdm
.
- Displays a real-time progress bar for each download using
- Reliable Downloads:
- Utilizes
yt-dlp
for fast and dependable video downloads.
- Utilizes
- Error Handling:
- Automatically retries failed downloads.
If you want to skip the trouble of installing Python or dependencies, simply download the prebuilt executable file (Private YouTube Downloader.exe
) from the Releases section.
- Download the
.exe
file. - Place your
cookies.txt
andvideo_links.txt
in the same directory as the executable. - Double-click the
.exe
file and follow the prompts to start downloading.
Antivirus Note:
Some antivirus programs might flag the .exe
file as suspicious because it bundles Python and dependencies into a single package. If this happens:
- Whitelist the
.exe
file in your antivirus settings. - Alternatively, you can verify the source code in this repository and build the executable yourself.
If you prefer to run the script directly, follow these steps:
Before running the script, ensure you have the following installed:
- Python 3.6+
yt-dlp
,tqdm
, andtkinter
(included inrequirements.txt
)
- Clone the repository to your local machine by running:
git clone https://github.com/Monster-ZeroX/Private-YouTube-Downloader.git cd Private-YouTube-Downloader
pip install -r requirements.txt
pip install yt-dlp
tkinter
is used for GUI components. It should come pre-installed with Python. To check if it's installed, run:
python -m tkinter
If this opens a window with a simple interface, you're good to go! If not, you can install tkinter based on your operating system:
- On Debian/Ubuntu
sudo apt-get install python3-tk
- On Windows and macOS,
tkinter
is usually included with Python, so you shouldn't need to install it manually.
To authenticate and download private YouTube videos, you need to provide a cookies.txt
file, which stores your browser session information. Here’s how to export it from Google Chrome (instructions are similar for other browsers):
- Go to the Chrome Web Store: Get cookies.txt LOCALLY Extension
- Click "Add to Chrome" and confirm the installation.
- Navigate to YouTube and log in to your account (make sure you can access the private videos you want to download).
- Click the EditThisCookie icon in the toolbar.
- Click on the "Export" button.
- Save the cookies as a .txt file on your system.
Important: Ensure that the cookies.txt file contains Netscape format cookies, which is the required format for yt-dlp.
Create a plain text file named video_links.txt
that contains one YouTube video URL per line. For example:
https://www.youtube.com/watch?v=XXXXXXXXXXX
https://www.youtube.com/watch?v=YYYYYYYYYYY
Once you have your cookies.txt
and video_links.txt
files ready, you can run the script to start downloading videos.
Open a terminal or command prompt, and navigate to the directory where the script is located. -Execute the script by running:
python download_videos_manual.py
- A file dialog will open asking you to select the cookies.txt file you exported from your browser.
- A file dialog will also prompt you to select the video_links.txt file containing the YouTube video URLs.
- Lastly, you will be prompted to choose the directory where you want to save the downloaded videos.
The script will download each video and display a progress bar showing the download status, including the download speed and percentage completed.
Example Output:
Found 1 video(s) to download.
Downloading video 1/1: https://www.youtube.com/watch?v=VVEYA2kObV0
Downloading https://www.youtube.com/watch?v=VVEYA2kObV0: 50%|█████ | 50/100 [00:10<00:10, 5MB/s]
Successfully downloaded: https://www.youtube.com/watch?v=VVEYA2kObV0\
All done!
This project is licensed under the GNU General Public License v3.0.
Feel free to fork this repository and submit pull requests for improvements and bug fixes. Contributions are welcome!
This tool is for educational purposes only. Please ensure you have the necessary permissions to download the videos.