If you use Android and love tinkering with powerful tools, you should learn how to configure Termux and yt-dlp are a brutal combination Download videos and audio from tons of websites directly to your phone. The best part is you can do it without root access, without ad-filled apps, and with complete control over file formats, quality, and destination.
Below you will find a complete guide, designed for everyday use, where you will see How to install and configure Termux, yt-dlp, Python, and FFmpeg, how to grant access to internal storage, how to create a convenient configuration file and, if you want to take it a step further, how to integrate everything with the Android “Share” menu or even with advanced scripts.
What is yt-dlp and why use it in Termux?
YT-DLP is a free and open source command line tool It's used to download videos and audio from platforms like YouTube, Vimeo, Twitter, Facebook, TikTok, Instagram, and many others. It's a modern fork of youtube-dl and youtube-dlc, with more maintenance, more features, and support for more websites.
When you use it from Termux on Android, you basically turn your mobile phone into a Mini Linux terminal capable of downloading, converting, and organizing videos It's like you're on a computer. It doesn't have a graphical interface, but in return you gain speed, flexibility, and a ton of options.
Among its most interesting features, yt-dlp allows:

- Choose video and audio format (MP4, MKV, WebM, etc.), resolution and quality with considerable accuracy.
- Download audio only (for example, in MP3) from a video, ideal for music, podcasts or talks.
- Save playlists and entire channels, selecting which videos you want to download and which you don't.
- Manage subtitles: download them in multiple languages, embed them, or save them in separate files.
- Controlling paths and file namesusing templates to keep everything neatly organized.
- Integrate with SponsorBlock to skip sponsored segments of many YouTube videos.
- Automate downloads and retrieshandling network errors, bandwidth limits, and more.
The big drawback for some users is that it does not have a graphical interface It's operated solely with commands, but once you configure it a bit and learn two or three basic lines, it's much faster and more reliable than almost any app on the Play Store.
Legal notice and responsible use
Before we continue, it's important to make one thing clear: Downloading videos may violate copyright or terms of service from platforms like YouTube or other websites. This guide is for informational purposes only.
Legitimate use of yt-dlp typically includes things like Download your own content, public domain videos, open-licensed material or educational resources with the author's permission. It is your responsibility to ensure that you comply with the law in your country and that you respect the terms and conditions of each site.
Install Termux correctly on Android
To work comfortably with yt-dlp on Android, the first thing to do is install a Updated version of Termux from reliable sourcesDon't use the one from Google Play, because it's outdated.
On most mobile phones, the recommended approach is:
- Download Termux from F-Droid, which keeps the app up to date.
- On some Xiaomi phones, the proprietary software manager includes a full version of Termux that usually works well.
Install Termux, open it, and before anything else, it's advisable update repositories and packagesIn some guides you will see that it is recommended to change the package source (for example, to the Grimler repository) because the default repositories sometimes give 404 errors or stop updating correctly.
For mobile phones with limited RAM or storage, The package update may fail several times and that Termux "forgets" the repository change and reverts to the original. In that case, there's no other option than to repeat the update process and, if necessary, reconfigure the Termux sources until everything completes without errors.
Grant Termux access to internal storage
To conveniently save videos and audio to your mobile device, Termux needs permission to access shared storage of Android (the typical folder where Downloads, DCIM, etc. are located).
In Termux, this is managed with a specific command that creates a link to the Android shared directory within the Termux environment. Once executed, you can navigate to that folder from the terminal and download your files there. You'll typically end up working with paths like /storage/emulated/0/Download or similar, which is where you can then see everything with your phone's file explorer. If you want, you can also Use your mobile phone as a secure file server to access and manage files from other computers.
Update Termux and install basic dependencies
Before messing with yt-dlp, it's advisable to leave the Termux system. as clean and up-to-date as possibleTermux allows you to install packages with different commands from the APT family: you may see commands like apt, apt-get or pkg; they all manage packages but the syntax and some internal details change slightly.
If you're coming from Debian or classic Ubuntu, you might have muscle memory with apt-get and use it regularly; it works the same way in Termux. On some devices with less RAM, you'll have to repeat the update several times because it stops due to insufficient resources. When this happens, simply run the commands again until the update completes without errors.
After updating, it's time to install the two key components that yt-dlp will use internally:
- ffmpeg, which is the multimedia engine that allows you to combine audio and video, convert between formats, handle subtitles, etc.
- Pythonbecause yt-dlp is written in this language and needs its interpreter to function.
On some mobile phones, especially low-end models, the Installing FFmpeg can be cumbersome Because it carries dozens of packages (around 50 or more). If Termux runs out of memory and crashes, a practical technique is to note the names of some of the packages that are causing the error and install them separately, reducing the list that FFmpeg has to resolve all at once.
Something similar happens with Python, although it's usually lighter than FFmpeg. If you see error messages when installing it, the usual cause is Try again several times and, if the repository has reverted to the default value, change it back. and repeat the installation until it is complete.
Install yt-dlp on Termux
Once you have Python and FFmpeg working, you can install yt-dlp on Android using Termux. The most common way is through pip, the Python package manager, which downloads the latest stable version from the official repository.
Some older guides recommend installing it using another method (for example, by downloading the binary directly), but in Termux it is usually more convenient and flexible. install yt-dlp as a Python packageThis way you can easily update it and take advantage of additional dependencies such as the mutagen library.
Mutagen is a Python library used for read and write audio file metadata (for example, MP3 ID3 tags, album art, title, artist, etc.). Combined with yt-dlp and FFmpeg, it allows you to ensure that when you convert a video to audio, the resulting track retains the video's image as album art and the metadata correctly.
Once yt-dlp is installed, it's advisable to get used to update it from time to time You can use the same package manager (pip) or the built-in auto-update feature, because video sites are constantly changing and an older version might not work with some websites. A reasonable interval is to check for updates every month or two.
Configure storage access to download to internal memory
With Termux, FFmpeg, Python, and yt-dlp ready, the next logical step is Configure the location where you will save the downloadsAlthough Termux has its own internal file system, the most practical approach on Android is to write to shared storage in order to view and move files with any app.
With permissions enabled from Termux, you can use standard Linux commands to navigate between directories and check your location. Ideally, once inside the shared path (for example, the Download folder), you should use yt-dlp there so that The files are saved directly where you will later use them.without having to copy them from one place to another. You can also configure and Use your mobile phone as an FTP server for fast transfers between devices when moving many files.
If you want to further refine the organization, you can create a a specific folder for your video downloads, something like /storage/emulated/0/YtDownloadDir (you choose the name), and leave it as your usual working directory in Termux.
Create and use the yt-dlp configuration file
It's a bit of a drag being always writing the same long parameters Every time you want to lower something (quality, format, path, subtitles, etc.). To avoid this, yt-dlp allows you to use a configuration file (yt-dlp.conf) where you define your default options.
This file can be placed in different locations depending on the system: in traditional Linux, there is usually a global version in /etc/yt-dlp.conf and another in the user's home directory. In environments like Termux, the most practical approach is place a configuration file in your user directory, with the parameters you want to be applied whenever you run yt-dlp without additional options.
In that file you can define, among other things:
- La folder where videos will be saved by defaultFor example, a path that points to your internal storage.
- La template for file namesFor example, by using the video title instead of the URL.
- El preferred output format, such as MP4 or MKV, and the combination of better video + better audio.
- La Downloading and embedding thumbnails and metadata in the final file.
- La subtitle managementwhether to download them, embed them, or choose specific languages.
Once you have the configuration file adjusted, simply pass the URL of the video or playlist to yt-dlp and All your preferences will be applied automatically. without having to write the entire line each time.
In Windows, the configuration file plays a similar role, although the path changes: it is usually located within the user's application data folder (for example, in a path like APPDATA/yt-dlp/config), and is saved as a normal text file.
Basic commands for downloading videos and audio
The basic principle of using yt-dlp, in Termux, Linux, or Windows, is to call the program followed by one or more URLsIf you run it without parameters or links, you will see an error message indicating that you must provide at least one link.
Some typical usage patterns in the terminal would be:
- Request help and view all available options, including formats, filters, network parameters, etc.
- List all available formats for a specific video, considering the resolution, audio and video codec, estimated size, etc.
- Download a video of the best possible video and audio quality within a specific format such as MP4, merging both tracks with FFmpeg.
For example, it is very common to use a combination where the best available video and the best audio are selected and they are asked to... merge into a final MP4If FFmpeg is not installed or is not found in the path, yt-dlp will display a warning indicating that it cannot combine formats and will either download separate tracks or fail to perform the desired merge.
If you only want audio, yt-dlp has options for Extract the audio and convert it directly to MP3, M4A, or other formatsIt again relies on FFmpeg. It's especially useful for converting music videos, lectures, or podcasts without having to deal with external converters afterward.
Subtitle and format management with yt-dlp
One of the major advantages of yt-dlp over many download apps is that it allows work comfortably with subtitlesWith a few parameters, you can tell it to download embedded subtitles from YouTube or other platforms, save them in separate files, or embed them in the final video itself.
You can filter by language using the usual codes (es, en, fr, etc.) and even request a download all languages availableTo embed subtitles in the video, you need to have FFmpeg properly installed, as it is responsible for combining them with the video stream.
Regarding output formats, yt-dlp can generate, with the help of FFmpeg, files in MP4, MKV, WebM, FLV, AVI or MOVAmong others. MP4 is usually the most compatible option with mobile phones and televisions; MKV is very flexible if you need multiple audio tracks or subtitles; WebM is an open format well-supported by modern browsers. Older formats like FLV or AVI are used less and less, but they are still available for specific situations.
Integrate yt-dlp with the Android Share menu using Termux
It's very convenient to be able to open YouTube or another video app on Android, tap on Share and choose Termux This allows you to download content without having to manually copy and paste the URL. Termux offers a specific mechanism for this through the termux-url-opener script.
The idea is to create a script with that name in the appropriate directory within Termux, give it execute permissions, and then... receive the shared URL as an argumentFrom there, in the script you can ask the user to choose the quality or you can define a default download mode (for example, best video+audio in MP4).
Some tutorials go a step further and accompany termux-url-opener with other auxiliary scripts which manage menus for selecting resolution or download type. This way, when you share a video from the official YouTube app, Dailymotion, or any website that has a sharing option, Termux opens, the script detects the URL, and lets you choose how you want to download it.
This approach almost completely eliminates the need to write commands by hand every time. You just need to have the scripts properly configured once, and then they become a kind of customized "mini app" that does exactly what you need.
Using yt-dlp on Linux and Windows outside of Termux
Although the focus here is on Termux and Android, the entire logic of yt-dlp is identical on desktop Linux and WindowsThe installation method has changed, but the basic commands remain the same.
In Linux (for example Ubuntu or Debian) you have several options: use the Official binary from GitHub You can place it in /usr/local/bin, install it from third-party repositories, or use pip. On Debian-based distributions like MX Linux and antiX, there are tutorials that explain how to use additional repositories to install yt-dlp with its auxiliary tools.
For Windows, the typical thing to do is download the executable yt-dlp.exe Download the file from the official repository and save it in a folder like C:\ytdlp. This file is the program itself, not an installer. If you add this folder to your PATH environment variable, you can run yt-dlp from any console without having to be in the exact directory.
In both systems, it is advisable to have FFmpeg and FFprobe properly installed and added to the PATHFFprobe is installed along with FFmpeg and is used to analyze media files, read codecs, duration, resolution, and other metadata that yt-dlp may need for some advanced functions.
Advanced automation: configuration files and shell aliases
Beyond the configuration file, those who use yt-dlp extensively can get even more out of it by alias in the shell configuration file (for example, .bashrc in Bash). An alias is basically an abbreviation of a long command.
For example, you can define a short alias that, when you type a single word in the terminal, launches yt-dlp with all the options you usually use: better video+audio in MP4, embedded subtitles, embedded thumbnails, file name based on title, etc.
On desktop Linux, this greatly simplifies usage: instead of remembering a nearly kilometer-long line of code, you type something like “ydlmp4” followed by the URL and forget about it. You can also take advantage of these aliases in Termux, with the added benefit that They load automatically every new terminal session from your .bashrc file or from the configuration file of the shell you use.
Furthermore, in server environments or remote seedboxes, it is common to combine yt-dlp with scheduled tasks (cron in Linux, Task Scheduler in Windows) to automate downloads of playlists, podcasts, or entire channels at specific times. Some seedbox providers even promote the use of yt-dlp on their powerful machines to download large volumes of data with 10 Gbps connections, ample storage, and streaming services like Plex or Jellyfin on top.
Advantages and disadvantages of yt-dlp compared to other solutions
YT-DLP has become the go-to tool for many users because it brings together several clear advantages over classic alternatives like youtube-dl or many graphical appsAmong the strengths are:
- It is free and open source, with an active community that fixes bugs and adds support for new sites.
- It works on multiple platforms.Windows, macOS, Linux, Android (via Termux) and any environment with Python.
- Offers a huge number of download options: formats, subtitles, thumbnails, retries, authentication with websites, etc.
- He is able to automatically retry failed downloads several times before quitting, which is very useful on unstable connections.
- Supports integration with extensions and external services such as SponsorBlock, and it works wonderfully with custom scripts.
On the downside, not everyone is willing to deal with a purely command-line tool. For some users, the lack of a clear graphical interface It's a hindrance, and having to learn about options and parameters can be intimidating at first.
Final considerations
Nor is there always a Official package perfect for all distributions Linux or all systems, so in some cases you have to use third-party repositories or download binaries manually. And, of course, there's the legal aspect: although the reality is that many people use it without incident, downloading copyrighted content without permission is illegal. can cause problems if it is done contrary to current legislation or the terms of service.
With all that said, Termux plus yt-dlp form a very powerful pair for anyone who wants Full control over your video and audio downloads on Android without relying on dubious applications, being able to fine-tune format, quality, subtitles, metadata and destination with great precision and, if desired, automate the process with scripts and aliases until the work is limited to sharing a link and letting the mobile do the rest. Share the guide and more users will learn about the topic.