Skip to content

Instantly share code, notes, and snippets.

@cyrillkuettel
Last active January 7, 2026 04:22
Show Gist options
  • Select an option

  • Save cyrillkuettel/d63785cf5f4c00106ae215188c377515 to your computer and use it in GitHub Desktop.

Select an option

Save cyrillkuettel/d63785cf5f4c00106ae215188c377515 to your computer and use it in GitHub Desktop.

yt-dlp termux full installation guide.md

Prepare

  1. Install Termux from Github: https://github.com/termux/termux-app/releases
  2. Download the apk and install it -> Note that installing termux from Play Store is highly discouraged.

In Termux:

pkg update
pkg upgrade

pkg install python

pip install --upgrade pip

Install yt-dlp (originated from youtube-dl)

# let's allow termux to access the phone's storage, it will ease our workflow:
pkg install termux-api
termux-setup-storage 

More info why this is needed here https://wiki.termux.com/wiki/Termux-setup-storage

This simlinks ~/storage to the default home directory.

# yt-dlp action Now we can download videos and music using yt-dlp. LIke

cd  ~/storage/downloads # note: this points to /storage/emulated/0/Download

# yt-dlp depends on ffmpeg
pkg install ffmpeg
pip install -U --no-deps yt-dlp

yt-dlp https://www.youtube.com/watch?v=dQw4w9WgXcQ

That's it! You're done

Bonus: Other useful packages

pkg install neofetch

pkg install imagemagick
pkg install git
pkg install vim 

ZSH

pkg install zsh
# set zsh to be the default shell
chsh -s zsh
# oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

ZSH plugins

pkg install build-essential 
pkg install file
pkg install curl 

cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Edit the ~/.zshrc file to include the newly installed plugins

@divinity76
Copy link

in

pip install -U --no-deps yt-dlp

why the -U --no-deps ? i don't recall needing that when installing yt-dlp on my termux

@cyrillkuettel
Copy link
Author

To prevent build errors in python dependencies:

ERROR: Failed building wheel for pycryptodomex
Failed to build brotli pycryptodomex
ERROR: Could not build wheels for brotli, pycryptodomex, which is required to install pyproject.toml-based projects

See comment above by Fjorstut. It might be fixed now, I haven't tried this since.

@divinity76
Copy link

divinity76 commented Jan 7, 2026

@cyrillkuettel sounds like something pkg install build-essential would fix, but i do actually have a brand new phone (well, old phone, Google Pixel 5, Android 14, but factory resetted) that I can check on.

on your instructions

$ pip install --upgrade pip
ERROR: Installing pip is forbidden, this will break the python-pip package (termux). 

so that's a bust. but yt-dlp seems to work fine without -U --no-deps:

~ $ pip install --upgrade pip
ERROR: Installing pip is forbidden, this will break the python-pip package (termux).
~ $ pip install --upgrade yt-dlp
Collecting yt-dlp
  Downloading yt_dlp-2025.12.8-py3-none-any.whl.metadata (180 kB)
Downloading yt_dlp-2025.12.8-py3-none-any.whl (3.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 2.3 MB/s  0:00:01
Installing collected packages: yt-dlp
Successfully installed yt-dlp-2025.12.8
~ $ pip install --upgrade yt-dlp
Collecting yt-dlp
  Downloading yt_dlp-2025.12.8-py3-none-any.whl.metadata (180 kB)
Downloading yt_dlp-2025.12.8-py3-none-any.whl (3.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 2.3 MB/s  0:00:01
Installing collected packages: yt-dlp
Successfully installed yt-dlp-2025.12.8
~ $ yt-dlp https://m.youtube.com/watch?v=dQw4w9WgXcQ
[youtube] Extracting URL: https://m.youtube.com/watch?v=dQw4w9WgXcQ
[youtube] dQw4w9WgXcQ: Downloading webpage
WARNING: [youtube] No supported JavaScript runtime could be found. Only deno is enabled by default; to use another runtime add  --js-runtimes RUNTIME[:PATH]  to your command/config. YouTube extraction without a JS runtime has been deprecated, and some formats may be missing. See  https://github.com/yt-dlp/yt-dlp/wiki/EJS  for details on installing one
[youtube] dQw4w9WgXcQ: Downloading android sdkless player API JSON
[youtube] dQw4w9WgXcQ: Downloading web safari player API JSON
WARNING: [youtube] dQw4w9WgXcQ: Some web_safari client https formats have been skipped as they are missing a url. YouTube is forcing SABR streaming for this client. See  https://github.com/yt-dlp/yt-dlp/issues/12482  for more details
[youtube] dQw4w9WgXcQ: Downloading m3u8 information
WARNING: [youtube] dQw4w9WgXcQ: Some web client https formats have been skipped as they are missing a url. YouTube is forcing SABR streaming for this client. See  https://github.com/yt-dlp/yt-dlp/issues/12482  for more details
[info] dQw4w9WgXcQ: Downloading 1 format(s): 401+251
[download] Destination: Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster) [dQw4w9WgXcQ].f401.mp4
[download]   0.0% of  229.20MiB at  582.54KiB/s ETA 06:5[download]   0.0% of  229.20MiB at  751.26KiB/s ETA 05:1[download]   0.0% of  229.20MiB at    1.30MiB/s ETA 02:5[download]   0.0% of  229.20MiB at    2.35MiB/s ETA 01:3[download]   0.0% of  229.20MiB at    4.20MiB/s ETA 00:5[download]   0.0% of  229.20MiB at    2.72MiB/s ETA 01:2[download]   0.1% of  229.20MiB at    2.56MiB/s ETA 01:2[download]   0.1% of  229.20MiB at    3.19MiB/s ETA 01:1[download]   0.2% of  229.20MiB at    3.11MiB/s

^ prior to that i had ran pkg install ffmpeg .

@divinity76
Copy link

@cyrillkuettel tl;dr they fixed it, you should remove -U --no-deps from your instructions.

(and fwiw i did not come here because i needed help with termux/yt-dlp, this gist was just randomly recommended to me when i visited gist.github.com and i checked it out)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment