In this tutorial, we are going to see the method to Install youtube-dl on Termux Terminal Emulator for Android.

Already we Publish the Method to Install youtube-dl on Ubuntu - youtube-dl Software Helps us to Download the Videos & Audios from Youtube in Different Formats.

Download Youtube videos on your Android device by using Termux.it's very to install & download the youtube videos & audio From the Command Line with youtube-dl.

Table of Contents

  1. Package Requirements
  2. Install youtube-dl
  3. Install via Shell Script
  4. Install via cURL
  5. How to use?
  6. Uninstall

Requirements

pkg install ffmpeg

Install youtube-dl on Termux

  • Open the termux APP
  • Install youtube-dl via cURL
curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /data/data/com.termux/files/usr/bin/youtube-dl
  • Give Permission to Execute the Script
chmod a+rx /data/data/com.termux/files/usr/bin/youtube-dl
  • Verify your Installation
which youtube-dl

Install youtube-dl on Termux

  • Learn More about youtube-dl Command Line tool
youtube-dl --help
  • Update Youtube-dl
chmod a+rx /data/data/com.termux/files/usr/bin/youtube-dl
youtube-dl -U

Shell Script to Download youtube-dl

Bash Shell Script to youtube-dl on Termux Terminal Emulator

#!/bin/bash
# -----------------------------------------------------------------------------
# Info:
# author: Santhosh veer
# file: youtube-dl.sh
# created: 18.09.2018
# revision: 18.09.2018
# version: 0.3
# -----------------------------------------------------------------------------
# Requirements:
# Python, ffmpeg, cURL
# Description:
# youtube-dl Downloader for Termux Terminal Emulator
#
# -----------------------------------------------------------------------------
## Update packages
echo "+++ Updating the Packages +++"
echo "+++ Running Command pkg up +++"
pkg up
echo -e "\\n"
echo "+++ Packages are Updated Successfully +++"
sleep 2;
echo -e "\\n"
## Install dependency packages
echo -e "+++ Install dependency packages +++"
sleep 2;
echo -e "\\n"
echo -e "+++ Install python +++"
echo -e "\\n"
pkg install python -y
sleep 2;
echo -e "+++ Install cURL +++"
echo -e "\\n"
pkg install curl -y
sleep 2;
echo -e "\\n"
echo -e "+++ install ffmpeg (For Audio Conversion) +++"
echo -e "\\n"
pkg install ffmpeg -y
sleep 2;
echo -e "\\n"
echo -e "+++ Successfully Installed the dependency packages +++"
sleep 2;
echo -e "\\n"
## Download Youtube-dl
echo -e "+++ Downloading Youtube-dl +++"
echo -e "+++ Please Wait +++"
curl -s -L https://yt-dl.org/downloads/latest/youtube-dl -o /data/data/com.termux/files/usr/bin/youtube-dl
sleep 2;
echo -e "+++ Youtube-dl Downloaded Successfully +++"
echo -e "\\n"
sleep 2;
## Set Permission
echo -e "+++ Set Permission to Execute the Script +++"
chmod a+rx /data/data/com.termux/files/usr/bin/youtube-dl
echo "+++ Permission Granted +++"
sleep 2;
echo -e "\\n"
## Verify the Installation
echo -e "+++ Verifiy Installation +++"
youtube-dl --version
command -v youtube-dl
sleep 2;
echo -e "\\n"
echo "+++ Installation completed successfully +++"
echo "+++ You can Now use Youtube-dl to download the Youtube Videos +++"
view raw youtube-dl.sh hosted with ❤ by GitHub

Download via cURL

Download and Install via cURL Command

curl -sL https://gist.githubusercontent.com/mskian/6ea9c2b32d5f41867e7cafc88d1b26d5/raw/youtube-dl.sh | bash

Usage

Youtube Video and Audio Downloader for Android.

Download youtube videos

youtube-dl YOUTUBE VIDEO URL

List the Video Formats

youtube-dl --list-formats YOUTUBEVIDEOURL

Download youtube video by using Format code

youtube-dl -f FORMATCODE YOUTUBEVIDEOURL

Download as MP3

youtube-dl --extract-audio --audio-format mp3 YOUTUBE VIDEO URL
Install youtube-dl on Termux

Uninstall youtube-dl

Uninstall youtube-dl from Termux

  • Installed Location - /data/data/com.termux/files/usr/bin/
  • Goto youtube-dl installed location
cd /data/data/com.termux/files/usr/bin/
  • Remove/uninstall youtube-dl Software
rm youtube-dl

From the Editor's Desk

Hope this tutorial will help your install youtube-dl command line tool on Android by using termux.
If you have doubts feel free to comment here I will guide you.