ALRIGHT!
It is complete, i hope!
So, the code i "created" with help from other projects like my idiot test game; not important.
So, this is the code I made for downloading mp3 videos off youtube.
cls
@echo off
title youtube downloader
:downloader
echo youtuber downloader!!!
pause
set "site="
set /p "site=Please enter youtube link here> "
If Not Defined site cls & goto downloader
echo Do you want to download "%site%" as an audio file?
pause
set /p choice=
if %choice%== "yes" goto audio
if %choice%== "no" goto video
:audio
@echo off
echo lol ok
C:\Users\NAME\Documents\youtube-dl\youtube-dl.exe %site% -x --audio-format best --ffmpeg-location C:\Users\NAME\Documents\youtube-dl\ffmeg\bin
exit
:video
@echo off
C:\Users\NAME\Documents\youtube-dl.exe %site%
exit
So this is how it works:
First, the downloader is started using the batch file. The files first asks what video of the site they want to download. Using the set "site="
command. Then I ask if I want to download this is as an audio file, which is what I download the most. So, it takes the link, and goes to either audio or video. Then, it will use the command + the video link.
C:\Users\NAME\Documents\youtube-dl\youtube-dl.exe %site% -x --audio-format best --ffmpeg-location C:\Users\NAME\Documents\youtube-dl\ffmeg\bin
basically takes the youtube-dl.exe and tells it to download the site, using the best audio format available, then links it to the ffmpeg location, which is in my youtube-dl folder, which I will have to link to the binary folder, or "bin". Ffmpeg is a tool that can help change the file types for videos and audios. An alternative to ffmpeg is avconv.
Next is video
C:\Users\NAME\Documents\youtube-dl.exe %site%
youtube-dl automatically downloads as video without any tool, so if you intend only to download mp4, just use this:
@echo off
title youtube downloader
:downloader
echo youtuber downloader!!!
pause
set "site="
set /p "site=Please enter youtube link here> "
If Not Defined site cls & goto downloader
echo Downloading %site% ...
C:\Users\NAME\Documents\youtube-dl.exe %site%
exit
The video will download in the batch file folder, so I would put the batch in a folder in desktop, and make the file hidden so it would look less disordered. Then I'd put the batch in my start(in windows).
Sorry, but in the end, it will open the youtube-dl folder(sorry)
I am not a pro at batch, I have never took any courses, but I hope you learned something from my mini project!
Refrences:
my old projects
youtube-dl's documentation link
my computer
youtube
my kid dream to be a hacker(it's not going well)