This post is on installing the youtube-dl tool on a Windows computer.
The installation instructions are pretty straightforward. For windows you can download the latest, or search for what you want at the download page.
Again, check the installation instructions, but C:\Users\username\yt-dl
is for example a good place for the .exe
file. Put that folder into your PATH variable (usually in your own user's PATH). In english search for the term: windows path variable
, in hungarian: windows path környezeti változó
. At this point the following should work (of course with your installed version):
C:\Users\username\youtube-dl --version
2019.02.18
If this works, you have succesfully installed youtube-dl.
The following commands are useful (for me at least). These are for windows. Create a new textfile and rename it to something.bat
. Tested only with youtube.
Download the video and extract the audio to mp3 (best quality). Video file is deleted afterward.
@echo off
set /P dl=YouTube URL:
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 %dl%
pause
Download the video and extract the audio to mp3 (best quality). Keep the original video.
@echo off
set /P dl=YouTube URL:
youtube-dl --keep-video --extract-audio --audio-format mp3 --audio-quality 0 %dl%
pause
Download the best resolution, but 1920×1080p maximum.
@echo off
set /P dl=YouTube URL:
youtube-dl -f "bestvideo[height<=1080]+bestaudio/best[height<=1080]" %dl%
pause
Download the video at the best available resolution.
@echo off
set /P dl=YouTube URL:
youtube-dl %dl%
pause