Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Tutorials»Download YouTube Videos in Linux Command Line

    Download YouTube Videos in Linux Command Line

    RahulBy RahulJanuary 19, 20162 Mins ReadUpdated:January 11, 2021

    Generally, we download videos from YouTube using the web browser. But now you can also download videos from YouTube using the command line.

    The youtube-dl is an command line utility is developed by the the youtube-dl.org team. It is build on Python programming language, which is also required this script.

    This tutorial will help you to install youtube-dl on your Linux system. Also provides you multiple useful examples for downloading audio and videos directly from Youtube.

    Installing Youtube-DL

    Use the following command to install a YouTube command-line downloader as per your Linux operating system.

    The Recommended Way

    To install it right away for all UNIX users (Linux, macOS, etc.), type:

    sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl 
    sudo chmod a+rx /usr/local/bin/youtube-dl 
    

    If you do not have curl, you can alternatively use a recent wget:

    sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl 
    sudo chmod a+rx /usr/local/bin/youtube-dl 
    

    From Repositories

    1. Installing on Ubuntu, Debian and LinuxMint
      sudo apt-get install youtube-dl
      
    2. CentOS/RHEL 7/6 and SL
      sudo yum install youtube-dl
      
    3. CentOS/RHEL 8 and Fedora
      sudo dnf install youtube-dl
      

    Download Audio & Videos with Youtube-dl

    Now use the followings set of example commands to download Youtube videos with different-2 options and formats as per your requirements.

    1. Download Video – Use this command to download videos directly on your system.

    youtube-dl https://www.youtube.com/watch?v=McuF7g14hYw
    
    
    [youtube] McuF7g14hYw: Downloading webpage
    [youtube] McuF7g14hYw: Downloading video info webpage
    [youtube] McuF7g14hYw: Extracting video information
    [youtube] McuF7g14hYw: Downloading DASH manifest
    [youtube] McuF7g14hYw: Downloading DASH manifest
    [download] Destination: How to Download Java Archive using Command Line -McuF7g14hYw.mp4
    [download] 100% of 3.79MiB in 00:09
    

    2. Save Videos with Different Name – Use option -o followed by new video file name to save on your system disk.

    youtube-dl https://www.youtube.com/watch?v=McuF7g14hYw -o Video.mp4 
    
    
    [youtube] McuF7g14hYw: Downloading webpage
    [youtube] McuF7g14hYw: Downloading video info webpage
    [youtube] McuF7g14hYw: Extracting video information
    [youtube] McuF7g14hYw: Downloading DASH manifest
    [youtube] McuF7g14hYw: Downloading DASH manifest
    [download] Destination: Video.mp4
    [download] 100% of 3.79MiB in 00:07
    

    3. Download Audio in MP3 Only – You can simply download audio of any video on your system in mp3 formats, like following commands.

    youtube-dl --extract-audio --audio-format mp3 https://youtu.be/McuF7g14hYw -o audio.mp3
    
    [youtube] McuF7g14hYw: Downloading webpage
    [youtube] McuF7g14hYw: Downloading video info webpage
    [youtube] McuF7g14hYw: Extracting video information
    [youtube] McuF7g14hYw: Downloading DASH manifest
    [youtube] McuF7g14hYw: Downloading DASH manifest
    [download] Destination: /home/sysadmin/Desktop/audio.mp3
    [download] 100% of 4.16MiB in 00:11
    [ffmpeg] Correcting container in "audio.mp3"
    [ffmpeg] Post-process file audio.mp3 exists, skipping
    
    Video Downloader Youtube
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow To Setup Nette PHP Framework on Ubuntu & LinuxMint
    Next Article How To Install Nette PHP Framework on CentOS / RHEL / Fedora

    Related Posts

    What is the /etc/aliases file

    2 Mins Read

    What is the /etc/nsswitch.conf file in Linux

    2 Mins Read

    How to Setup Squid Proxy Server on Ubuntu and Debian

    Updated:June 17, 20225 Mins Read

    How to Delete a Let’s Encrypt Certificate using Certbot

    Updated:June 3, 20222 Mins Read

    How to Install Latest Git on Ubuntu 22.04

    Updated:May 31, 20222 Mins Read

    How To Install LibreOffice on Ubuntu 22.04

    Updated:May 23, 20222 Mins Read

    2 Comments

    1. franck swip on January 17, 2020 5:32 pm

      Hi Rahul,
      The command for Ubuntu, Debian and LinuxMint should be :
      $ sudo apt-get install youtube-dl
      Cheers

      Reply
    2. Milani on June 2, 2016 11:42 pm

      My friend uses this method to download in linux. I use windows and many software are available in windows platform.

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • What is the /etc/aliases file
    • What is the /etc/nsswitch.conf file in Linux
    • How to Install Ionic Framework on Ubuntu 22.04
    • What is the /etc/hosts file in Linux
    • How to Install Angular CLI on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.