An automated termux-url-opener script powered by yt-dlp that intelligently handles video downloads without user interaction
- Automated Quality Selection: Automatically chooses the best quality based on link type
- Background Processing: Downloads continue even after closing Termux
- Smart Directory Organization: Files are automatically sorted into appropriate folders
- Retry Mechanism: Automatically retries failed downloads
- No User Prompts: Zero interaction required after sharing a link
Install the Termux:API app
Run these commands:
termux-setup-storage
pkg update
pkg install python3 aria2 ffmpeg jq termux-api
pip install --upgrade yt-dlp
mkdir ~/bin
wget https://github.com/Rims-Naps/termux-url-opener/raw/master/termux-url-opener -P ~/bin
chmod +x ~/bin/termux-url-opener
From any supported app (YouTube, YouTube Music, or other video platforms), simply:
- Click
Share > Termux
- The download will start automatically
- The Termux window will close, and download continues in background
Downloads are automatically organized in your Android internal storage:
- YouTube Music downloads →
storage/shared/music/
- YouTube videos →
storage/shared/youtube/
-
62CE
Other platform videos →
storage/shared/unknown/
- YouTube Music (music.youtube.com) → Downloads best quality audio as MP3
- YouTube (youtube.com, youtu.be) → Downloads best quality video as MP4
- Other platforms → Downloads best available format
- Smart Quality Selection
- YouTube Music: Best audio quality with metadata and thumbnails
- YouTube Videos: Best video+audio quality with metadata
- Other Platforms: Best available quality
- Retry System: Automatically retries failed downloads up to 3 times
- Background Processing: Downloads continue even when Termux is closed
- Automated Organization: Files are sorted by platform type
- Zero Configuration: No setup or choices needed after installation
Works with all sites supported by yt-dlp. See the yt-dlp supported sites list for more details.
If you encounter Permission denied
errors:
- Go to Android Settings > Apps > Termux
- Manually grant Storage permission
- Do NOT run
termux-setup-storage
again as it may wipe your internal storage