A simple Python program to download YouTube videos and playlists (in mp4/mp3 format).
This program is based on :
- PyTube (Downloading YouTube videos)
- FFmpeg (Combining video and audio files, converting audio files to .mp3 and video files to .mp4)
You can simply execute the requirements_installer.py
to automatically install all the necessary libraries, or you can install them manually using this command :
pip install pytube ffmpeg-python
Then, open the main.py
file and change the dlpath
to your downloads directory :
e.g. C:\Users\Username\Downloads for windows users.
e.g. /home/Username/Downloads for linux users.
... and make sure the last character is not \
or /
.
- Run the main file.
- Type
V
orv
for a single video, andP
orp
for a playlist. - Type
V
orv
to for MP4 video format, andA
ora
for MP3 audio format. - Type the url of the video/playlist and wait for the video(s) to get loaded.
If you are downloading a single video, a list of all available resolutions will appear then you will have to choose one of them by typing it (e.g. 1080p
).