Davi is a simple yet powerful shell script that leverages yt-dlp to download videos and audio from YouTube and many other video-hosting sites. It's designed to be easy to use with common options and includes support for Termux on Android and various Linux distributions.
- Download Videos/Audio: Easily download videos, audio-only, or entire playlists.
- Format & Quality Control: Specify desired formats (mp4, mkv, mp3, etc.) and quality (best, 1080p, etc.).
- Resume Downloads: Automatically resumes interrupted downloads.
- Subtitle Support: Embed subtitles or download auto-generated ones.
- Configurable: Customize default settings via a simple configuration file.
- Cross-Platform: Works on Termux (Android) and various Linux distributions (Debian, Ubuntu, Fedora, Arch, Alpine).
- Easy Alias: Use a short
dvcommand for quick access.
- Download the project: Download the compressed file from the GitHub repository or clone it:
git clone https://github.com/feraskm/DaVi.git
cd DaVi-
Run the installation script:
sudo chmod +x install.sh sudo ./install.sh
The installer will:
- Copy
davi.shto a suitable location in yourPATH. - Create an alias
dvin your~/.bashrcand~/.zshrcfor easy access. - Create a default configuration file (
~/.dlconfig) if it doesn't exist. - Provide instructions on how to install
yt-dlpandffmpegfor your specific system (Termux/Linux).
- Copy
-
Install Dependencies: Follow the instructions provided by the
install.shscript to installyt-dlpandffmpeg.- For Termux:
pkg install python python-yt-dlp ffmpeg(andtermux-setup-storage). - For Linux: Use your distribution's package manager (e.g.,
sudo apt install yt-dlp ffmpeg) orpip.
- For Termux:
-
Reload your shell: After installation, run
source ~/.bashrcorsource ~/.zshrcor restart your terminal to activate thedvalias.
Use the dv command followed by options and the video/playlist URL.
dv [Options] <video_or_playlist_url>audio: Download audio only.video: Download video (default).playlist: Download full playlist.--formatFORMAT: Specify file format (e.g.,mp4,mkvforvideo;mp3,wavfor audio).--qualityQUALITY: Download quality (e.g.,best,worst,720p,480p`).--resume: Resume interrupted downloads.--config: Create or recreate the default config file (~/.dlconfig).--help: Display help message.
dv [https://www.youtube.com/watch?v=dQw4w9WgXcQ](https://www.youtube.com/watch?v=dQw4w9WgXcQ)
dv [https://www.youtube.com/watch?v=dQw4w9WgXcQ](https://www.youtube.com/watch?v=dQw4w9WgXcQ) audio
dv [https://www.youtube.com/playlist?list=PLqc_aT2_aC_jKkS_jXlZ_xZ_xZ_xZ_xZ](https://www.youtube.com/playlist?list=PLqc_aT2_aC_jKkS_jXlZ_xZ_xZ_xZ_xZ) playlist
dv [https://www.youtube.com/watch?v=dQw4w9WgXcQ](https://www.youtube.com/watch?v=dQw4w9WgXcQ) --format mkv --quality 720p
dv --resumeYou can customize the default download settings by editing the ~/.dlconfig file.
# Example content of ~/.dlconfig
OUTPUT_DIR="${HOME}/Downloads/media"
VIDEO_FORMAT="mp4"
AUDIO_FORMAT="mp3"
VIDEO_QUALITY="best"
AUDIO_QUALITY="0"
EMBED_SUBS="yes"
AUTO_SUBS="no"To remove Davi and its associated files:
sudo chmod +x uninstall.sh
sudo ./uninstall.shThis will remove the script, the alias, and offer to remove the config file.
yt-dlporffmpegnot found: Ensure you have installed the dependencies as per the installation instructions.- "externally-managed-environment" error with pip: On newer Python versions, pip might restrict global installs. Try
sudo pip install yt-dlp --break-system-packageswith caution, or use your system's package manager. - Termux Storage: If you encounter storage issues in Termux, run
termux-setup-storage.
Feel free to open issues or pull requests on the GitHub repository if you have suggestions for improvements or bug fixes.