This script allows you to download YouTube videos using the Pytube library. It reads a list of YouTube video URLs from a file (urls.txt
) and attempts to download each video in the highest resolution possible (720p, 480p, or 360p with audio)also able to download whole youtube playlist.
- Run
pip install requirements.txt
- Create a text file named
urls.txt
in the same directory as the script. - Add one YouTube video URL per line in the
urls.txt
file. - Run the script using the command
python downloader.py
in your terminal or command prompt.
- Run the script using the command
python playlist.py
in your terminal or command prompt. - Enter the playlist URL when prompted.
- Downloaded videos will be stored in the 'Youtube_Videos' folder in the script's directory.
- The script will remove successfully downloaded video URLs from the
urls.txt
file. - If an error occurs during the download, the script will print an error message and continue to the next video.
- If the 'Youtube_Videos' folder does not exist, the script will create it.
- The script prioritizes downloading videos in the following resolutions: 720p, 480p, and 360p with audio.
- If a video cannot be downloaded due to an error, the error message will be displayed, and the script will proceed to the next video.
This script is for educational and personal use only. Respect the intellectual property rights of the content creators and adhere to YouTube's terms of service.
This project is licensed under the MIT License - see the LICENSE file for details.
Rajkishor Patra
Thanks goes to these wonderful people (🤗):
Rajkishor Patra |
BenoitPrmt |