One-click downloading of YouTube videos straight from the YouTube app.
Download the Termux terminal emulator from the Play Store.
pkg update && pkg upgrade
termux-setup-storage
pkg install python nano
pip install youtube-dl
mkdir /data/data/com.termux/files/home/storage/shared/Youtube
mkdir -p ~/.config/youtube-dl
nano ~/.config/youtube-dl/config
The Volume-Down key emulates Ctrl in termux
Save it with "Volume-Down" + O, then close nano with "Volume-Down" + X
--no-mtime
-o /data/data/com.termux/files/home/storage/shared/Youtube/%(title)s.%(ext)s
-f "best[height<=1080]"
The height value limits video quality, change to 240-360-480-720-1080, etc. to suit your needs or bandwidth restrictions.
9. Create "termux-url-opener" in ~/bin to enable one-click download via the "Share" menu in the youtube app
mkdir ~/bin && cd "$_"
nano termux-url-opener
Save it with "Volume-Down" + O, then close nano with "Volume-Down" + X
youtube-dl $1
To download a YouTube video from within the YouTube app, click the "Share" link under the video, and choose "Termux".
The download will start and will be available in the "YouTube" folder in the root of your internal storage.
If Termux keeps running you can close it by simply typing exit
and pressing enter afterwards.