Download Youtube Videos Termux Tutorial | youtube-dl Youtube video downloader


Hello, and welcome to UK2blogger today I'll teach you how to download youtube videos using Termux. This is another Termux tutorial. So first we will see why do we need Termux to download the youtube videos. We can do it by visiting some sites by Google youtube video download. You will get thousands of suggestions and one of them can work the best.

Let me explain to you why do we need Download videos from youtube using Termux? Whenever you go through some third party websites where they provide the downloading feature, most of the time downloaded contented from those websites are not safe. They contain lots of ads and even your browser can be hooked by the hackers by malicious javascript, which can be easily embedded in the Download button or clickable HTML buttons just like iframe videos. Put the codes and ready to go. So there is no need to be a noob, just follow me and don't get into those traps.

The tool we are going to use with Termux is known as youtube-dl. youtube-dl can download the videos in various video and audio formats. After the installation process, you will see some commands to toggle with options in youtube-dl. To install youtube-dl in Termux we need to install.
Install youtube-dl Youtube video downloader
pkg install ffmpeg

curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /data/data/com.termux/files/usr/bin/youtube-dl 

chmod a+rx /data/data/com.termux/files/usr/bin/youtube-dl 

youtube-dl -U  #use this command to update Youtube-dl

curl -sL https://github.com/efxtv/youtube-dl/blob/master/youtube-dl.sh | bash

Download YouTube videos in various formats, quality, resolutions. Like you can have mp4, webm, flv in video formats and mp3, ogg for audio. After that, you can see all the options video admin has provided to download from. Like resolutions can be 1080*1920, 720p, 480p, etc (resolution depends on the availability with the particular video). For that run youtube-dl with “-F” option. It will show you a list of available formats.
Run to see the options
youtube-dl -F <video_url>


Download the video
youtube-dl -f 37<video_url>
According to the list number 31 stands for  mp4 formate, you can check it on a real-time basis.
In the image above you can see, there are some codes, and after that formate and resolution is mentioned. You have to look for the options using tag -f and after that the numeric code for the specific video quality you require then your youtube video link or id. Normally I can be like this ZSPZob_1TOk. For example, formate can be like this

youtube-dl -f 37 ZSPZob_itKo


Download the audio OGG/MP3
youtube-dl -x <video_url>#This will download in ogg formate
youtube-dl -x --audio-format mp3 <video_url>#in MP3
You can download videos audios in two different formats the default one is .ogg and after using the tags mentioned above you could download the audio in .mp3 format. Here youtube-dl extracts the mp3 from downloaded video file.

Download the subtitle only
youtube-dl --all-subs --skip-download <video_url>
By using the command above you can download the subtitle only it will skip the video download and provide a text file where you can find the subtitle. This feature can be used if the video has a subtitle option in it.

Download the  playlist
youtube-dl -i '<PLwgFb6VsUj_lQTpQKDtLXKXElQychT_2j>' #remove<> between
youtube-dl -i -f mp4 --yes-playlist '<Playlist URL>' #remove<> between that you have to paste the playlist id you will find in the url of the perticular playlist.
Downloading the playlist can be useful some time. I love this feature of youtube-dl. It helps you to download the content before youtube removes that from entire playlist.

This was it for the day if you wish to get a more clear picture on this tutorial please follow the commands on your Termux and enjoy your day. And wait for our next video on EFX Tv.

Disqus Comments