{"id":1482,"date":"2022-05-24T23:39:00","date_gmt":"2022-05-24T23:39:00","guid":{"rendered":"https:\/\/www.ridiculously-simple.com\/?p=1482"},"modified":"2026-06-02T16:34:27","modified_gmt":"2026-06-02T16:34:27","slug":"downloading-video-from-youtube","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2022\/05\/24\/downloading-video-from-youtube\/","title":{"rendered":"Downloading video from youtube"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This might sound complicated, but youtube videos come in many shapes, many of them have either video only, or audio only !<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">the best way to get a full resolution video is to download then combine video and audio ! this can be done automatically by yt-dlp<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installing<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The copy of yt-dlp in the debian repositories is currently out of date and non functional, so instead you might want to install it with<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo curl -L https:\/\/github.com\/yt-dlp\/yt-dlp\/releases\/latest\/download\/yt-dlp -o \/usr\/local\/bin\/yt-dlp<br>sudo chmod a+rx \/usr\/local\/bin\/yt-dlp<br><br>yt-dlp -v<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In addition to the above, make sure you have nodejs and python3 and ffmpeg installed<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Configuring<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"> I use the following settings in my config file (note to self: this is on vm129)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">--no-js-runtimes<br>--js-runtimes node<br>--format \"bv*[vcodec^=avc1][height&lt;=1080]+ba[ext=m4a]\/b[ext=mp4]\"<br>--merge-output-format mp4<br>-o \"%(title)s.%(ext)s\"<br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With the above in my config file, All i need to do is fire up &#8220;yt-dlp URL&#8221;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Other setups<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Following, i explain how it is done manually, for me, to download files that work great with my cheap chinese android tv box (that keeps trying to hack my network) on VLC *(Using hardware decoder)&#8230;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But before we go there, youtube throttles the speed you download videos at ! so youtube-dl needs patching, an alternative would be yt-dlp (<a href=\"https:\/\/github.com\/yt-dlp\/yt-dlp#installation\">See here<\/a>)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The easier way to install would be<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt install yt-dlp<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, if you insist on pip, you can do the following<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install python3-pip\n\npython3 -m pip install --force-reinstall https:\/\/github.com\/yt-dlp\/yt-dlp\/archive\/master.tar.gz<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let us try downloading a video\/audio<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">youtube-dl -F https:\/\/www.youtube.com\/watch?v=mUvrLxaSolc<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The line above will show you a bunch of options and their IDs, what you need to do now is to download the ones you need with a command such as <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">youtube-dl -f 270 https:\/\/www.youtube.com\/watch?v=mUvrLxaSolc<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, to combine them (Audio and video) without re-encoding&#8230;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ffmpeg -i ao.webm -i vo.webm -c:v copy -c:a copy output.webm<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">But remember when you download, <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Only VP8 or VP9 or AV1 video and Vorbis or Opus audio and WebVTT subtitles are supported for WebM.<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">If you have installed via pip3<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">\/usr\/local\/bin\/yt-dlp ...<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This might sound complicated, but youtube videos come in many shapes, many of them have either video only, or audio only ! the best way to get a full resolution video is to download then combine video and audio ! this can be done automatically by yt-dlp Installing The copy of yt-dlp in the debian [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,26,137,133,6,16,134],"tags":[131,42,130,128,129],"class_list":["post-1482","post","type-post","status-publish","format-standard","hentry","category-audio","category-encoding-decoding","category-ffmpeg","category-internet-2","category-multimedia","category-video","category-youtube","tag-combine","tag-convert","tag-lossless","tag-webm","tag-youtube"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/1482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=1482"}],"version-history":[{"count":14,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/1482\/revisions"}],"predecessor-version":[{"id":6307,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/1482\/revisions\/6307"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=1482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=1482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=1482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}