This is a basic background music player made with Nim to play YouTube Playlists in the background. It is focused on being very light weight and easily accessible, even if you don't have a Desktop Environment or Window Manager.
Looking for the C++ version? Click here. Take note that it is no longer being developed.
Note: You should have a stable internet connection to use YouTube playlist player with YouTube playlists.
paru -S ytbgmplayer-git
Clone or download the files run this in the project root directory: nimble install
There are 2 ways to run this software, with or without flags. Without any flags it will provide a CLI you can use to play your playlists, with flags it will immediately start playing playlists.
ytbgmplayer
- this will provide the CLI
ytbgmplayer 1 2 --shuffle --loop
- this will play playlist nr 1 and 2, shuffle them and loop them.
ytbgmplayer 1 2 -sl
- this is the short version of the above
ytbgmplayer --list
- list all available playlists, if this flag is used, no other flags are allowed
You can use whichever AUR package manager you prefer to update the package
Follow all the steps as in install.
If you want to compile the source code yourself, you'll need the dependencies listed below.
To compile the code (for release): nimble build -d:release
To compile the code (for debugging): nimble build
To run the code (debugging): nimble run
- Nim (only if compiling from source)
- Nimble (only if compiling from source)
- The latest version of mpv. (Debian/Ubuntu-based users will have to add a repository and install the latest version:
add-apt-repository ppa:mc3man/mpv-tests -y
) - yt-dlp
Action | Key |
---|---|
Pause | Space |
Mute | m |
Skip 10 Seconds | Right Arrow |
Rewind 10 Seconds | Left Arrow |
Skip 1 Minute | Up Arrow |
Rewind 1 Minute | Down Arrow |
Next Song | > |
Previous Song | < |
Quit | q |
The playlist file (also known as the save file) is stored in $HOME/.config/ytbgmpcli/playlists.json
, this is where all the playlists and their related details are stored.
You can play playlists from either on YouTube or your current machine (locally).
You can add both playlists from YouTube and from your machine. To add a playlist from YouTube, just copy the link to the playlist and when you have to insert the playlist link in th "Add Playlist" option, just paste the link. When you want to add a playlist from your machine (locally), create a folder, put all the music in there that you want in the playlist, navigate your terminal to that folder (cd /path/to/folder), when inside the folder type the command "pwd" and copy the output. When you have to add the location of the file in "Add Playlist", just paste the copied output into the input. Done.
You can edit your playlist details, such as the playlist name and the playlist location/link.
Once you have listened too much to a playlist, it is time to delete it. You can easily do that by choosing the delete option.
If playing the playlist in it's normal order (YouTube: The way you ordered the playlist | Local: A-Z) then you can shuffle it and enjoy yourself.
If you don't want to use the interface, you can use flags to do some of the things you need to do.
This flag is used to run a playlist without opening the interface, this can be done by running ytbgmplayer with the playlist number afterwards. This should always be added when using multi-answer flags.
Example of the playlist flag: bgmplayer 2
(will play playlist nr. 2)
Another example of the playlist flag: bgmplayer 1 2
(will play playlist nr. 1 & 2)
Flag | Short | Action |
---|---|---|
--help | -h | Displays help |
--list | N/A | Displays all playlists |
--random | -r | Play all your playlists in random order |
--shuffle | -s | Shuffle playlists |
--loop | -l | Loop playlists |
If you want to support the work I do, please consider donating to me on one of these platforms: