{"id":12638,"date":"2019-03-28T05:12:21","date_gmt":"2019-03-28T05:12:21","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12638"},"modified":"2019-03-28T05:12:21","modified_gmt":"2019-03-28T05:12:21","slug":"install-youtube-dl-a-command-line-video-download-tool-for-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/28\/install-youtube-dl-a-command-line-video-download-tool-for-linux\/","title":{"rendered":"Install YouTube-DL \u2013 A Command Line Video Download Tool for Linux"},"content":{"rendered":"<p><strong>youtube-dl<\/strong>\u00a0is a\u00a0<strong>Python<\/strong>\u00a0based small command-line tool that allows to download videos from\u00a0<strong>YouTube.com<\/strong>,\u00a0<strong>Dailymotion<\/strong>,\u00a0<strong>Google Video<\/strong>,\u00a0<strong>Photobucket<\/strong>,\u00a0<strong>Facebook<\/strong>,\u00a0<strong>Yahoo<\/strong>,\u00a0<strong>Metacafe<\/strong>,\u00a0<strong>Depositfiles<\/strong>\u00a0and few more similar sites. It written in\u00a0<strong>pygtk<\/strong>\u00a0and requires\u00a0<strong>Python<\/strong>\u00a0interpreter to run this program, it\u2019s not platform restricted. It should run on any\u00a0<strong>Unix<\/strong>,\u00a0<strong>Windows<\/strong>\u00a0or in\u00a0<strong>Mac OS X<\/strong>\u00a0based systems.<\/p>\n<p>Recently,\u00a0<strong>youtube-dl<\/strong>\u00a0added video download support for\u00a0<strong>17<\/strong>\u00a0new websites:\u00a0<strong>brightcove.com<\/strong>,\u00a0<strong>auengine.com<\/strong>,\u00a0<strong>RingTV<\/strong>,\u00a0<strong>instagram.com<\/strong>,\u00a0<strong>Jukebox<\/strong>,\u00a0<strong>3sat<\/strong>,\u00a0<strong>CSpan<\/strong>,\u00a0<strong>Statigr.am<\/strong>,\u00a0<strong>traileraddict.com<\/strong>,\u00a0<strong>hotnewhiphop.com<\/strong>,\u00a0<strong>wat.tv<\/strong>,\u00a0<strong>tu.tv<\/strong>,\u00a0<strong>gamespot.com<\/strong>, t<strong>udou.com<\/strong>,\u00a0<strong>Wimp.com<\/strong>,\u00a0<strong>archive.org<\/strong>\u00a0and\u00a0<strong>break.com<\/strong><\/p>\n<p><strong>youtube-dl<\/strong>\u00a0also allows to choose specific avialable video quality format to download or let the program itself automatically download higher quality video from the site. It also has supports for user\u00a0<strong>specific playlist<\/strong>downloads, options to add custom or\u00a0<strong>original title<\/strong>\u00a0to the downloaded video file.\u00a0<strong>proxy support<\/strong>\u00a0and many more.<\/p>\n<div id=\"attachment_15570\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/07\/Download-YouTube-Videos-in-Linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-15570\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/07\/Download-YouTube-Videos-in-Linux.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/07\/Download-YouTube-Videos-in-Linux.png 720w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/07\/Download-YouTube-Videos-in-Linux-620x297.png 620w\" alt=\"Linux Commandline YouTube Video Download\" width=\"620\" height=\"297\" aria-describedby=\"caption-attachment-15570\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-15570\" class=\"wp-caption-text\">Download YouTube Videos in Linux<\/p>\n<\/div>\n<h3>Install YouTube-DL in RHEL\/CentOS and Fedora<\/h3>\n<p>The\u00a0<strong>youtube-dl<\/strong>\u00a0program can be installed by\u00a0<a href=\"https:\/\/www.tecmint.com\/how-to-enable-epel-repository-for-rhel-centos-6-5\/\" target=\"_blank\" rel=\"noopener\">enabling epel repository<\/a>\u00a0under your systems. Once enabled, you can install using \u2018<strong>yum<\/strong>\u2018 package manager tool as shown.<\/p>\n<pre># yum install youtube-dl<\/pre>\n<p><strong>Update<\/strong>: If you don\u2019t wish to add any third party repository, you can still install it right away using\u00a0<strong>curl<\/strong>\u00a0or\u00a0<strong>wget<\/strong>command as shown.<\/p>\n<pre># curl https:\/\/yt-dl.org\/latest\/youtube-dl -o \/usr\/local\/bin\/youtube-dl\r\nOR\r\n# wget https:\/\/yt-dl.org\/downloads\/latest\/youtube-dl -O \/usr\/local\/bin\/youtube-dl\r\n<\/pre>\n<p><strong>Note<\/strong>: Your system must have\u00a0<strong>curl<\/strong>\u00a0or\u00a0<strong>wget<\/strong>\u00a0packages installed to fetch the recent version\u00a0<strong>youtube-dl<\/strong>\u00a0file. If you don\u2019t have them, you may\u00a0<strong>yum<\/strong>\u00a0to get it.<\/p>\n<p>After fetching the file, you need to set a executable permission on the script to execute properly.<\/p>\n<pre>chmod a+rx \/usr\/local\/bin\/youtube-dl\r\n<\/pre>\n<h3>Install YouTube-DL in Ubuntu\/Linux Mint and Debian<\/h3>\n<p><strong>Ubuntu<\/strong>\u00a0users can download and install latest\u00a0<strong>youtube-dl<\/strong>\u00a0version from the\u00a0<a href=\"https:\/\/launchpad.net\/~nilarimogard\/+archive\/webupd8\" target=\"_blank\" rel=\"nofollow noopener\">webupd8 PPA<\/a>\u00a0as shown.<\/p>\n<pre>$ sudo add-apt-repository ppa:nilarimogard\/webupd8\r\n$ sudo apt-get update\r\n$ sudo apt-get install youtube-dl<\/pre>\n<p><strong>Update<\/strong>: Similarly, instead using any third party PPA, you can use\u00a0<strong>curl<\/strong>\u00a0or\u00a0<strong>wget<\/strong>\u00a0command to install latest version of\u00a0<strong>youtube-dl<\/strong>\u00a0script as shown.<\/p>\n<pre>$ sudo curl https:\/\/yt-dl.org\/latest\/youtube-dl -o \/usr\/local\/bin\/youtube-dl\r\nOR\r\nsudo wget https:\/\/yt-dl.org\/downloads\/latest\/youtube-dl -O \/usr\/local\/bin\/youtube-dl\r\n<\/pre>\n<p>After downloading the script, set the executable permission.<\/p>\n<pre>$ sudo chmod a+rx \/usr\/local\/bin\/youtube-dl\r\n<\/pre>\n<h3>Update YouTube-DL<\/h3>\n<p>Youtube-dl itself can be\u00a0<strong>updated<\/strong>\u00a0to the latest version using the following command.<\/p>\n<pre># youtube-dl -U<\/pre>\n<h5>Sample Output<\/h5>\n<pre>Updating to version 2015.09.03 ...\r\nUpdated youtube-dl. Restart youtube-dl to use the new version.\r\n<\/pre>\n<h3>How to Use YouTube-DL to Download Videos<\/h3>\n<p>To download a video file, simply run the following command. Where \u201c<strong>VIDEO_URL<\/strong>\u201d is the url of the video that you want to download.<\/p>\n<pre># <strong>youtube-dl https:\/\/www.youtube.com\/watch?v=iRYvuS9OxdA<\/strong><\/pre>\n<h5>Sample Output<\/h5>\n<pre>[youtube] iRYvuS9OxdA: Downloading webpage\r\n[youtube] iRYvuS9OxdA: Downloading video info webpage\r\n[youtube] iRYvuS9OxdA: Extracting video information\r\n[youtube] iRYvuS9OxdA: Downloading js player new-en_US-vflCeB3p5\r\n[youtube] iRYvuS9OxdA: Downloading DASH manifest\r\n[download] Destination: Amy Macdonald - This Is The Life-iRYvuS9OxdA.mp4\r\n[download] 100% of 10.33MiB in 00:01\r\n<\/pre>\n<p>To list all available formats of video, use option \u201c<strong>\u2013list-formats<\/strong>\u201d with the\u00a0<strong>youtube-dl<\/strong>\u00a0command.<\/p>\n<pre># <strong>youtube-dl --list-formats https:\/\/www.youtube.com\/watch?v=iRYvuS9OxdA<\/strong><\/pre>\n<h5>Sample Output<\/h5>\n<pre>[youtube] vKtwZmhX0lw: Downloading webpage\r\n[youtube] vKtwZmhX0lw: Downloading video info webpage\r\n[youtube] vKtwZmhX0lw: Extracting video information\r\n[youtube] vKtwZmhX0lw: Downloading DASH manifest\r\n[youtube] vKtwZmhX0lw: Downloading DASH manifest\r\n[info] Available formats for vKtwZmhX0lw:\r\nformat code  extension  resolution note\r\n171          webm       audio only DASH audio  113k , vorbis@128k (44100Hz), 1.86MiB\r\n140          m4a        audio only DASH audio  128k , m4a_dash container, aac  @128k (44100Hz), 2.14MiB\r\n141          m4a        audio only DASH audio  255k , m4a_dash container, aac  @256k (44100Hz), 4.30MiB\r\n278          webm       180x144    DASH video   63k , webm container, vp9, 1fps, video only, 946.76KiB\r\n160          mp4        180x144    DASH video  112k , avc1.4d400c, 15fps, video only, 1.86MiB\r\n242          webm       300x240    DASH video  170k , vp9, 1fps, video only, 2.50MiB\r\n133          mp4        300x240    DASH video  247k , avc1.4d400d, 25fps, video only, 4.11MiB\r\n243          webm       400x320    DASH video  288k , vp9, 1fps, video only, 4.07MiB\r\n13           3gp        unknown    small \r\n17           3gp        176x144    small ,  mp4a.40.2, mp4v.20.3\r\n36           3gp        320x240    small ,  mp4a.40.2, mp4v.20.3\r\n5            flv        400x240    small \r\n43           webm       640x360    medium ,  vorbis, vp8.0\r\n18           mp4        640x360    medium ,  mp4a.40.2, avc1.42001E (best)\r\n<\/pre>\n<p>To download a preferred file format, use the option \u2018<strong>-f\u2019<\/strong>\u00a0(video format code). For example, I would like to download\u00a0<strong>mp4<\/strong>\u00a0format, So I use format code as \u2018<strong>18<\/strong>\u2018 as shown below.<\/p>\n<pre># <strong>youtube-dl -f 18 https:\/\/www.youtube.com\/watch?v=iRYvuS9OxdA<\/strong><\/pre>\n<h5>Sample Output<\/h5>\n<pre>[youtube] iRYvuS9OxdA: Downloading webpage\r\n[youtube] iRYvuS9OxdA: Downloading video info webpage\r\n[youtube] iRYvuS9OxdA: Extracting video information\r\n[youtube] iRYvuS9OxdA: Downloading DASH manifest\r\n[download] Amy Macdonald - This Is The Life-iRYvuS9OxdA.mp4 has already been downloaded\r\n[download] 100% of 10.33MiB\r\n<\/pre>\n<p>To download a\u00a0<strong>list of video<\/strong>\u00a0files, create a file and place all the\u00a0<strong>YouTube<\/strong>\u00a0links that you wish to download.<\/p>\n<pre># <strong>youtube-dl -a youtube_links.txt<\/strong><\/pre>\n<p>Type the following command in a terminal to list all the avialable options.<\/p>\n<pre># youtube-dl --help<\/pre>\n<p>For other distributions, youtube-dl can be downloaded from the\u00a0<a href=\"https:\/\/rg3.github.io\/youtube-dl\/download.html\" target=\"_blank\" rel=\"nofollow noopener\">youtube-dl download<\/a>\u00a0page.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/install-youtube-dl-command-line-video-download-tool\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>youtube-dl\u00a0is a\u00a0Python\u00a0based small command-line tool that allows to download videos from\u00a0YouTube.com,\u00a0Dailymotion,\u00a0Google Video,\u00a0Photobucket,\u00a0Facebook,\u00a0Yahoo,\u00a0Metacafe,\u00a0Depositfiles\u00a0and few more similar sites. It written in\u00a0pygtk\u00a0and requires\u00a0Python\u00a0interpreter to run this program, it\u2019s not platform restricted. It should run on any\u00a0Unix,\u00a0Windows\u00a0or in\u00a0Mac OS X\u00a0based systems. Recently,\u00a0youtube-dl\u00a0added video download support for\u00a017\u00a0new websites:\u00a0brightcove.com,\u00a0auengine.com,\u00a0RingTV,\u00a0instagram.com,\u00a0Jukebox,\u00a03sat,\u00a0CSpan,\u00a0Statigr.am,\u00a0traileraddict.com,\u00a0hotnewhiphop.com,\u00a0wat.tv,\u00a0tu.tv,\u00a0gamespot.com, tudou.com,\u00a0Wimp.com,\u00a0archive.org\u00a0and\u00a0break.com youtube-dl\u00a0also allows to choose specific avialable video quality format to download &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/28\/install-youtube-dl-a-command-line-video-download-tool-for-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install YouTube-DL \u2013 A Command Line Video Download Tool for Linux&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12638","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12638","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12638"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12638\/revisions"}],"predecessor-version":[{"id":12639,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12638\/revisions\/12639"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}