Easy Youtube-DL MP3/MP4 download script

Nyoobu

Member
May 14, 2016
25
1
38
The main reason for this script is basically me being too lazy to type the same stuff over and over again.
I made it for myself, but i thought "why shouldn't i share it with others?" and the first thing that came to my mind was R4P3.

It basically is a batch-script which makes your youtube-download life on windows a bit easier.
After starting download.bat you basically put in the Youtube-Link and then choose between MP3 or MP4. [youtube-dl, ffprobe, ffmpeg and ffplay are included]
Also downloading whole playlists or channels is possible.
Then you can either put in another URL or exit the script.
Files automaticly download to ./download/video or ./download/audio, depending on if you chose MP3 or MP4.

Virustotal: Click 0/54
Download: Click

Neither Youtube-DL nor ffmpeg is made by myself.
I only wrote a small batch-script for myself, but shared it because i'm pretty sure someone else needs something like this.
I worked on making it as user-friendly as possible before releasing it.
Please report any errors to me. Also post ideas.
I linked Youtube-DL and ffmpeg below.
ffmpeg and ffprobe are required to extract the audio out of the MP4 (to get the MP3).
I included it so people dont have to look for it by themselves, or look up on how it works.
If you dont like the white-blue theme, simply edit the download.bat and change "color f9" to "color 07"
If you just press Enter without entering any URL it will automatically download my playlist.
You can also download videos from websites (for example http://www.nyoob.com )

In case you just want to see the batch-script:
Code:
@echo off
:start
cls
color f9
set link=https://www.youtube.com/playlist?list=PL4TecNz0bGglYq7p3fPss0sBF5B9Pepp0
echo [YTDL Script] Please enter the Link of the Video you would like to download.
echo [YTDL Script] Keep in mind, also Playlists are possible to download.
timeout -t 1 >> nul
set /p link=Video URL:
timeout -t 1 >> nul
cls
echo [YTDL Script] Do you want to download the Video or Audio-only!?

:choice
cls
choice /M "Type V for Video or A for Audio" /c VA
if errorlevel 255 (
    echo Error
)    else if errorlevel 2 (
    goto audio
)    else if errorlevel 1 (
    goto video
)    else if errorlevel 0 (
    echo CTRL+C has been pressed.
    timeout -t 5 >> nul
    goto choice
)

:video
cls
echo [YTDL Script] Changing Directory
cd ./ytdl
timeout -t 1 >> nul
echo [YTDL Script] Starting Video-Download
youtube-dl -f mp4 -o "../download/video/%%(title)s.%%(ext)s" %link%
timeout -t 1 >> nul
goto end

:audio
cls
echo [YTDL Script] Changing Directory
cd ./ytdl
timeout -t 1 >> nul
echo [YTDL Script] Starting Audio-Download
youtube-dl --extract-audio --audio-format mp3 -f bestaudio -o "../download/audio/%%(title)s.%%(ext)s" %link%
timeout -t 5 >> nul
goto end

:end
cls
echo Finished downloading.
timeout -t 2 >> nul
echo Type A to download another Video. Type E to exit the script. Type W to visit my Website
choice /M "(A)nother, (E)xit, (W)ebsite:" /c AEW
if errorlevel 255 (
    echo Error
)    else if errorlevel 3 (
    goto website
)    else if errorlevel 2 (
    goto exit
)    else if errorlevel 1 (
    goto start
)    else if errorlevel 0 (
    echo CTRL+C has been pressed.
    timeout -t 5 >> nul
    goto end
)

:website
cls
start "" http://www.nyoob.com
goto exit

:exit
cls
echo Thank you for using my Script! http://www.nyoob.com
echo.
echo Script will exit in 5 Seconds.
timeout -t 5 >> nul
echo Script will exit now. Bye! ^.^
timeout -t 1 >> nul
exit

Included but not by me:
Youtube-DL: https://rg3.github.io/youtube-dl/
ffmpeg: http://ffmpeg.org/
 
Last edited:
Top