YouTube Video Downloader in Termux – Installation & Usage Commands

Downloading YouTube videos in Termux is very easy. You can use a tool called yt-dlp to download videos, songs, and even full playlists on your phone. You can also choose video quality and save the file in your storage. In this guide, I will show you everything step by step in a very simple way.

Installation Commands

Update and upgrade all Termux packages:

pkg update && pkg upgrade

Install required packages:

pkg install python ffmpeg

Install yt-dlp using pip:

pip install yt-dlp

Check if yt-dlp is installed successfully:

yt-dlp --version

Storage Setup (Important)

Give Termux access to your phone storage:

termux-setup-storage

After running this command, allow the permission popup. Now your downloads will be available at: /storage/emulated/0/

Usage Commands

Download a YouTube video:

yt-dlp [video_link]

Download video in best quality:

yt-dlp -f best [video_link]

Download audio only (MP3):

yt-dlp -x --audio-format mp3 [video_link]

Download a full playlist:

yt-dlp [video_link]

Show all available video qualities:

yt-dlp -F [video_link]

Download a specific quality (example: 720p):

yt-dlp -f 22 [video_link]

Video Quality Format List (Example)

After running -F, you may see formats like:

  • 18 → 360p
  • 22 → 720p
  • 137 → 1080p (video only)
  • 140 → audio only

You can combine video + audio like this:

yt-dlp -f 137+140 [video_link]

Move Video to Gallery Storage

By default, files are saved in the Termux home directory.

Move video to your phone storage (Download folder):

mv *.mp4 *.webm /storage/emulated/0/Download/

Move audio files (MP3):

mv *.mp3 /storage/emulated/0/Music/

Now you can open your Gallery or File Manager and access the downloaded files easily.

READ ALSO  Wireshark (Tshark) in Termux – Installation & Usage Commands

Leave a Comment