For this post I will teach you how to install Youtube-dl inside your android mobile phone and start downloading Youtube videos (movies, mp4), music (mp3) for free. Without further ado, let's start this tutorial.
Table of Contents:
👉 Installing and running Termux app
👉 Downloading Python and Python2 using Termux
👉 Downloading and running Youtube-dl using Termux
👉 Downloading video, music using Youtube-dl
👉 Locating the downloaded video and music

How to install YouTube-dl in Android phone and download YouTube videos/music/mp3

Installing Termux app in android phone

1. Open your Google Play app and search for "termux." When the Termux result appears, press the Install button to continue.

2. After downloading and installing, open your Termux app.

3. Inside Termux, type the following command: pkg install python2 and press Enter.

4. In the question "Do you want to continue? [Y/n]" that will appear, type Y and press Enter.

5. Wait for the downloading to finish.

6. After the download is done, it will automatically install Python2, wait for it to finish also.

7. When done, you will see: Successfully installed pip-19.2.3 setuptools-41.2.0....

8. Now, type the following command: pkg install python and press Enter. If an error appears, just retry by pressing the ij icon located in the lower right corner of your Termux screen.

9. Assuming that there is no error, it will download Python. Just wait for it to finish.

10. When done, it will now unpack itself and install itself also.

11. If the installation is a success, a message saying: Successfully installed pip-21.1.3 setuptools-56.0. will appear.

12. To verify your installed python2, just type python2 and press Enter.
13. A message saying: Python 2.7.18 (default, Aug 1 2021, 19:01:43)..... or more information. will appear to show you that python is already installed.

14. To exit python, type exit() and press Enter.

Installation of Youtube-dl using Termux

1. Still, inside Termux, type the following command: curl -L -o /data/data/com/termux/files/usr/bin/youtube-dl and press Enter.

2. Wait for the download to finish.

3. When done, type the following command: chmod a+rx /data/data/com.termux/files/usr/bin/youtube-dl and press Enter.

4. To verify your youtube-dl directory type the following: which youtube-dl and press Enter.

5. It will then show you the exact location of your youtube-dl folder inside your phone.
6. Now, type the following command in Termux: curl sL and press Enter.

7. After a successful installation, a message saying: Installation completed successfully. You can now use Youtube-dl to download the Youtube videos. will appear.

Getting the Youtube video link

1. Leave your Termux for a while and open your internet browser and search for the Youtube video that you wanted to download. In the search results, press any video link to go to the actual video inside Youtube.

2. When the video is already playing, find the Share link and press that link.

3. Inside Share page, press the Copy button to copy the link of that Youtube video.

Downloading Youtube Video

1. Back inside Termux, the following code: youtube-dl -v [paste the Youtube URL here]. You need to long-press anywhere on the black screen to make the Copy/Paste/More menu appear. When it appears, press Paste.

2. After pasting, you should have: youtube-dl -v and press Enter.

3. The Youtube video will now start to be downloaded.

4. When done, you will see a 100% + the Youtube video size + time it took for the video to finish downloading.

Downloading Youtube Audio, mp3 or music

1. In your Termux, type youtube-dl -f 140 [paste your Youtube video URL]. Like the steps done above, you need to long-press to be able to paste the URL of the video.

2. You should have the following command: youtube-dl -f 140 Now, press Enter to start the download.

3. The download is now in progress.

4. When done, you will see there the 100% + size of audio + time spent when downloading the audio.

Locating the downloaded video and audio files

1. Open your File Manager.

2. Press Download folder.

3. Your downloaded files should already be found inside the Download folder. If not, then press the 3 lines located in the upper left corner of your screen.

4. In the menu that will appear, press Termux (lowest part of your screen).


5. And you will see there the download Youtube video and audio files.

6. Done!

👉 The downloaded audio file have .m4a extension. Just rename it and change its extension to .mp3 to make it an mp3 file.