This is a simple Python script that allows you to download YouTube videos and playlists.
- Python 3
- The pytube library
- PySimpleGUI
- ThreadPoolExecutor *concurrent.futures
pip install pytube
pip install PySimpleGUI
pip install ThreadPoolExecutor
pip install concurrent.futures
python3 main.py
The script will start by printing a menu with the following options:
Enqueue video
Example:
inputing URL
1) https://youtu.be/dQw4w9WgXcQ
(OR)
USE COMMA
2) https://youtu.be/dQw4w9WgXcQ , https://youtu.be/dQw4w9WgXcQ
Enqueue playlist Download the listed videos Exit To download a video, enter the video URL in the prompt and select option 1. To download a playlist, enter the playlist URL in the prompt and select option 2. To download all of the videos in the queue, select option 3. To exit the script, select option 4.
Workings The script works by first creating a YouTube object from the video or playlist URL. It then gets the highest resolution video stream and downloads it to the download directory.
If you want to change the default download directory, you can set the download_path variable.
Example To download the video with the URL https://www.youtube.com/watch?v=dQw4w9WgXcQ, you would enter the following command:
python3 main.py
I have changed the gui part as it was giving problems loading, will get back to this GUI soon as it gets fixed . ETA IDK
https://www.youtube.com/watch?v=dQw4w9WgXcQ
The script will then download the video to the download directory.
This script was created by Gurucharan.S.
- The script has been optimized to download videos more efficiently.
- The code has been documented to make it easier to understand.
- The README.md file has been updated to reflect the latest changes.
- No progress bar it will run fully in background with default of 1 thread
- The script may not work on all versions of Python.
- The script may not work on all videos.
- Implement MultiThread ( Work in progress )
- Use optimizing its dynamic thread allocation for downloding 2 types eg. Youtube video and playlist simultaniously .
- Implement fail safe if the downlode gets intrupted needs providing pop up
- Many more feature coming up StayTuned for more features to be added