music.sh is a simple Bash script that allows you to download, manage, and play music tracks from YouTube using yt-dlp
and mpv
. It provides a minimalist command-line interface for music management.
music.sh downloads or streams tracks from YouTube and allows you to list, search, play and delete downloaded tracks.
Ensure you have the following dependencies installed:
yt-dlp
mpv
jq
grep
Clone the repository and make the script executable. The script, by default, stores the music files and other data alongside itself, you can change this my editing the DIR
variable at line 5.
music.sh [option] [argument]
Options:
list
: Lists all downloaded tracks in {id}. {title} formatplay <id>
: Plays downloaded tracks, explained below in detailadd <keyword>
:Downloads music track, explained below in detaildelete <id>
: Deletes the track corresponding to<id>
search <keyword>
: Lists all tracks matching the keyword in {id}. {title} formatstream <keyword>
: Streams music track, explained below in detailhelp
: Shows this usage information.
music.sh play <keyword>
:
Plays the track corresponding to <id>
. Otherwise searches for <keyword>
in library. If only one match is found, plays directly else lists and gives option to play. A number qualifies as <id>
while everything else qualifies as <keyword>
.
music.sh add/stream <search term>
:
Searches and lists the top five search results on YouTube for the given , numbered 1 to 5. Enter the serial number of the track you wish to download/stream in the prompt that follows
This project is licensed under the MIT License. See the LICENSE file for details.