@sachithrrra

Published on

How to Install Youtube-DL on Windows

Update 21/12/2022: Use YT-DLP which is a fork of youtube-dl with additional features and fixes. You can use the same steps.

Youtube-DL is a great program to download videos from Youtube and other 100s of video sharing websites such as Dailymotion, Archive.org, Photobucket, Facebook, Instagram, Yahoo, Metacafe, Depositfiles. Youtube-DL is a command line program written using Python programming language. Its is available for Windows, Linux and macOS. Since this is a command line program, you have to follow some extra steps to configure everything.

Table of Contents

Prerequisites

Downloading and Installing Youtube-DL on Windows

1. Download the youtube-dl.exe

You can get it here from their official web-site. Move the EXE file inside a folder and place it somewhere familiar.

(Recommended C:/yt-dl/youtube-dl.exe)

2. Download ffmpeg (For advanced features. You can use youtube-dl without ffmpeg)

You can get it here from FFMPEGs web-site. Place the folder as we did before.

(Recommended C:/ffmpeg)

3. Add C:\yt-dl\ folder to PATH

If you want to use youtube-dl commands from any directory within the command line, you need to add youtube-dl to your Windows PATH environment variable.

  1. Right click This PC from file manager and select Properties.
  2. Select Advanced system settings from the top left corner.
  3. Select Environment Variables…
  4. Double-click the Path variable, in the top section.
  5. Select New and add C:\yt-dl\

Open a new Command Prompt window and run youtube-dl. If you’ve added Youtube-DL to the PATH correctly, you can see the below command.

youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.

Similarly, you can add C:\ffmpeg\bin\ to PATH and run ffmpeg command to check if ffmpeg is working correctly. You’ll see something like this, if you followed the steps correctly.

ffmpeg version 4.3.1-2020-11-08-full_build-www.gyan.dev Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10.2.0 (Rev3, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

YouTube-DL Basic Commands to Download Videos and Playlists

1. To download single video

youtube-dl <VIDEO URL>

2. To download all videos on a playlist

youtube-dl <PLAYLIST URL>

3. To download an entire channel

youtube-dl <CHANNEL URL>

4. To download multiple videos

youtube-dl <VIDEO URL 1> <VIDEO URL 2>

Alternatively, you can put them all in a text file and pass it to Youtube-dl like this.

youtube-dl -a youtube_links.txt

5. Selecting video quality

youtube-dl -F <VIDEO URL>

Output:

[youtube] dQw4w9WgXcQ: Downloading webpage
[youtube] dQw4w9WgXcQ: Downloading player 920e4583
[info] Available formats for dQw4w9WgXcQ:
format code  extension  resolution note
249          webm       audio only tiny   46k , webm_dash container, opus @ 46k (48000Hz), 1.18MiB
250          webm       audio only tiny   61k , webm_dash container, opus @ 61k (48000Hz), 1.55MiB
140          m4a        audio only tiny  129k , m4a_dash container, mp4a.40.2@129k (44100Hz), 3.27MiB
251          webm       audio only tiny  129k , webm_dash container, opus @129k (48000Hz), 3.28MiB
394          mp4        256x144    144p   68k , mp4_dash container, av01.0.00M.08@  68k, 25fps, video only, 1.72MiB
160          mp4        256x144    144p   71k , mp4_dash container, avc1.4d400c@  71k, 25fps, video only, 1.81MiB
278          webm       256x144    144p   89k , webm_dash container, vp9@  89k, 25fps, video only, 2.27MiB
133          mp4        426x240    240p  117k , mp4_dash container, avc1.4d4015@ 117k, 25fps, video only, 2.96MiB
395          mp4        426x240    240p  134k , mp4_dash container, av01.0.00M.08@ 134k, 25fps, video only, 3.40MiB
242          webm       426x240    240p  159k , webm_dash container, vp9@ 159k, 25fps, video only, 4.02MiB
134          mp4        640x360    360p  219k , mp4_dash container, avc1.4d401e@ 219k, 25fps, video only, 5.55MiB
396          mp4        640x360    360p  262k , mp4_dash container, av01.0.01M.08@ 262k, 25fps, video only, 6.64MiB
243          webm       640x360    360p  273k , webm_dash container, vp9@ 273k, 25fps, video only, 6.92MiB
135          mp4        854x480    480p  337k , mp4_dash container, avc1.4d401e@ 337k, 25fps, video only, 8.52MiB
244          webm       854x480    480p  397k , webm_dash container, vp9@ 397k, 25fps, video only, 10.04MiB
397          mp4        854x480    480p  450k , mp4_dash container, av01.0.04M.08@ 450k, 25fps, video only, 11.38MiB
136          mp4        1280x720   720p  655k , mp4_dash container, avc1.4d401f@ 655k, 25fps, video only, 16.57MiB
247          webm       1280x720   720p  699k , webm_dash container, vp9@ 699k, 25fps, video only, 17.67MiB
398          mp4        1280x720   720p  858k , mp4_dash container, av01.0.05M.08@ 858k, 25fps, video only, 21.70MiB
399          mp4        1920x1080  1080p 1576k , mp4_dash container, av01.0.08M.08@1576k, 25fps, video only, 39.84MiB
137          mp4        1920x1080  1080p 3546k , mp4_dash container, avc1.640028@3546k, 25fps, video only, 89.64MiB
18           mp4        640x360    360p  630k , avc1.42001E, 25fps, mp4a.40.2 (44100Hz), 15.95MiB (best)

You can use the format code to download the video

youtube-dl -f 18 <VIDEO URL>