This Python Program can be used in 2 main ways:
- Copy and Paste YouTube URLs one by one
- Place a combination of links in a Text File
Note
To get the file, you can either copy the main.py file from the GitHub.
The better way is to simply clone the repository with git clone https://github.com/Sunhaloo/PyYu
Well in this case, you would need to have Git!
Navigate to where you have the main.py or cloned the repository and simply run the file!
I will be using my directory as example to show you.
# changing directory to where I have the repository
cd ~/GitHub/PyYu
# run the python file
python main.pyThen follow these steps:
- Press
1if you want to convert a single YouTube video to Audio - Press
3if you want to download a single YouTube video - Press
1for either of these options ( Audio Converter or Video Downloader )- Then simply enter your URL with
Ctrl + Shift + V$\Rightarrow$ Paste without any formatting
- Then simply enter your URL with
For the multi-links, we are using the -a to pass text file to the yt-dlp command.
Hence, you are going to need a yt_urls.txt file at the ~/Desktop directory.
# change directory to Desktop
cd ~/Desktop
# create a new file
touch yt_urls.txtGo ahead an use your favourite text editor like VS Code, Sublime Text and others.
I use VIM BTW!
# change directory to Desktop
cd ~/Desktop
# create a new file
New-Item yt_urls.txt
# edit that very text file with Notepad
notepad yt_urls.txtAgain, I use VIM BTW!
Tip
For the above
# changing directory to where I have the repository
cd ~/GitHub/PyYu
# run the python file
python main.pySimilar to above main.py and simply run it!
- Press
1if you want to convert YouTube videos to Audio in order of song names - Press
2if you want to convert YouTube videos to Audio in sequential order of URLS in Text File - Press
3if you want to download YouTube videos - Press
2for either option number1or3( Audio Converter or Video Downloader )
Note
Today is the 10/02/2025 and I just added the function whereby you can download in order of number.
What do I mean by "number"? Well, I like to number my song's file name so that in most software, it will be able to play in order.
Therefore, when yt-dlp will download the song, it will prefix the first URL in text file with 1. ,
the second URL will be prefixed with 2. and so on.
Hence, you are going to have "song names" that are in order!
The program should automatically source the yt_urls.txt file and start to do its thing.
Warning
The contents of the text file yt_urls.txt should look something like this:
https://www.youtube.com/watch?v=dQw4w9WgXcQ
https://www.youtube.com/watch?v=R8vlNbk0Yww
https://www.youtube.com/watch?v=CzmXjvj4dikEven though I have a function to check for invalid YouTube links... Why make the mistake in the first place
Note
After you press these options ( for both... Audio and Video ), you will have to enter more options.
If you choose audio; you are going to have to enter the file format and bitrate. I recommend:
mp3for the file format360for the bitrate
If you choose video; you are going to have to enter the file format and FPS. I recommend:
mp4for the file format60for the FPS
Depending if you choose "audio" or "video". The program will create the output folder at the directory ~/Desktop/
- For audio, you are going to have a folder named
downloaded_audio - For video, you are going to have a folder names
downloaded_video
"Future" Plans... NOT in like a Week!
- Make this a multi-file project
- Will help me learn Python Project Directory Setup
- Cross Platform GUI Version
- Currently looking at:
- Kivy
- Qt
- Flet ( the "new" kid on the block )
- Currently looking at:
Well, thank you for using this shitty but useful program that I have made. I made this primarily to learn, but also I am going to remake my Music Playlist so you could say that "2 birds 1 stone"!
Please refer to the
learning.mdfile for my learning experiences and struggles, which provides more information about the code itself. Even if you don't use shitty program; Thank You for passing by!
- Instagram: https://www.instagram.com/s.sunhaloo
- YouTube: https://www.youtube.com/channel/UCMkQZsuW6eHMhdUObLPSpwg
S.Sunhaloo Thank You!