How to install youtube-dl (the easy way)

How to install youtube-dl (the easy way)

youtube-dl is an amazing and useful command line utility to download videos from YouTube, Vimeo, and more. This articles is about how to install youtube-dl on Windows, Linux, and Mac OSX.  youtube-dl is written in Python

so it’s also referred to as youtube-dl.py  or youtube-dl.exe  when compiled on Windows.

youtube-dl depends on ffmpeg or avconv for video transcoding and audio/video merging. We will install ffmpeg in this tutorial since it can be installed via choco on Windows.

DigitalOcean offers one-click deployment of popular applications such as WordPress, Django, MongoDB, Docker, and even preconfigured Kubernetes Clusters. Deploy your next app in seconds. Get $100 in cloud credits from DigitalOcean

Ad Notice I will receive a small commission that helps support this blog at no cost to you.

Steps to Install youtube-dl on Windows

  1. Install chocolatey/choco
  2. From a privileged command prompt run
C:\> choco install -y youtube-dl ffmpeg
  1. Verify that youtube-dl is installed and check the version.
C:\> youtube-dl --version
Install youtube-dl Windows
Click to Zoom

 


Steps to Install youtube-dl on Ubuntu Linux

install youtube-dl ubuntu-linux
youtube-dl can be installed on most Linux distributions using the built-in package manager (apt, yum, etc).

# apt based distros Ubuntu, Debian, etc
sudo apt install youtube-dl
# yum based distros Redhat, Centos, Fedora
sudo yum install youtube-dl

Steps to Install youtube-dl on Mac OSX

# OS X users can install youtube-dl with Homebrew:
brew install youtube-dl
# Or with MacPorts:
sudo port install youtube-dl

Steps to Install youtube-dl using python/pip

This method assumes you already have python and pip installed

# python 2.7
sudo pip install youtube-dl
# python 3.x
sudo pip3 install youtube-dl

Download a YouTube video using youtube-dl

youtube-dl usage example windows

Lets give it a try by downloading a youtube video from the command line.

youtube-dl https://www.youtube.com/watch?v=RpOlTN2xdwg
# output
[youtube] RpOlTN2xdwg: Downloading webpage
[youtube] RpOlTN2xdwg: Downloading video info webpage
[youtube] RpOlTN2xdwg: Extracting video information
[download] Destination: Wind turbine spinning in HD 1080p - short clip-RpOlTN2xdwg.f137.mp4
[download] 100% of 8.04MiB in 00:01
[download] Destination: Wind turbine spinning in HD 1080p - short clip-RpOlTN2xdwg.f140.m4a
[download] 100% of 503.80KiB in 00:00
[ffmpeg] Merging formats into "Wind turbine spinning in HD 1080p - short clip-RpOlTN2xdwg.mp4"
Deleting original file Wind turbine spinning in HD 1080p - short clip-RpOlTN2xdwg.f137.mp4 (pass -k to keep)
Deleting original file Wind turbine spinning in HD 1080p - short clip-RpOlTN2xdwg.f140.m4a (pass -k to keep)

Here are the video file’s properties and the downloaded video

file properties dialog

download videos with youtube-dl


What sites can youtube-dl download videos from?

Although the name implies that youtube-dl only works for downloading videos from youtube, I was shocked to discover  it supports over 1,000 other websites. Some popular ones include….


References

4 Replies to “How to install youtube-dl (the easy way)”

    1. If you are on Windows and you installed it with choco this should help you.

      c:\> where youtube-dl C:\ProgramData\chocolatey\bin\youtube-dl.exe

  1. Hello, when I try to download a video I get this error message:
    {ERROR: file:Mikakunin de Shinkoukei – Mashiro-tan Dancing!-d8MIAW2vYhc.f135.mp4: No such file or directory}
    How do I fix this

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.