Giter VIP home page Giter VIP logo

yt-playlist-bgm-player's Introduction

YouTube Playlist BGM Player

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.

Content

Running and Installing

Note: You should have a stable internet connection to use YouTube playlist player with YouTube playlists.

Install

AUR

paru -S ytbgmplayer-git

From Source

Clone or download the files run this in the project root directory: nimble install

Run

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.

Example 1

ytbgmplayer - this will provide the CLI

Example 2

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

Example 3

ytbgmplayer --list - list all available playlists, if this flag is used, no other flags are allowed

How to update

AUR

You can use whichever AUR package manager you prefer to update the package

From Source

Follow all the steps as in install.

Compiling the code

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

Dependencies

  • 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

Controls

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

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.

Features

Playing Playlists

You can play playlists from either on YouTube or your current machine (locally).

Adding Playlists

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.

Editing Playlists

You can edit your playlist details, such as the playlist name and the playlist location/link.

Deleting Playlists

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.

Shuffling Playlists

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.

Flags

If you don't want to use the interface, you can use flags to do some of the things you need to do.

The playlist flag

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)

All other flags

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:

liberapay kofi patreon paypal

yt-playlist-bgm-player's People

Contributors

rottencandy avatar weebnetsu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

rottencandy

yt-playlist-bgm-player's Issues

Create man page

Create a man page where all the details of --help can be entered. Then convert --help into a function that returns the available flags that can be used. For users on other systems without a man page, there can be a --man flag that does everything the current --help does.

No event handler for no playlist selected

When a user says bgmplayer -no-loop -no-shuffle then they should get an error message and the application should stop executing. The correct syntax would be: bgmplayer 3 -no-loop -no-shuffle.

Add Windows Support

Add support to run the application on Windows as well, without requiring WSL

Inline playlist updating

Update playlists via inline cli code. Instead of having to start the application, go to edit and then editing the code, allow it to be edited in one foul swoop, with flags, eg. bgmplayer --add nameOfPlaylist playlistLink -> add playlist in one line.

You should be able to

  • Add playlists
  • Delete playlists
  • Edit playlists

Backup and Restore

Add a backup option that creates a backup of the users playlists file and stores it where the user requests.

Add a restore option that restores a backup the user created.

Add settings

Add a file to store all the user settings and defaults. This could possibly be a great time to implement Lua for fun.

User settings and defaults should include:
[NOTE: cli ui -> the ui when no flags are added when running application]

  • Show prompt to shuffle playlist (if using cli ui)
  • Show prompt to loop playlist (if using cli ui)
  • Loop by default (if not using cli ui)
  • Shuffle by default (if not using cli ui)
  • Default backup location
  • Customize Text Colors

Online Backup/Restore

Allow the user to backup their playlist file online for 30 days (then delete it), they can have a special link that they can use to restore it again. Just paste the link in on bgmplayers restore option, it will download it and save it. The files CAN NOT be modified while online, they will be READ ONLY.

Create GUI

Create a GUI for those with less knowledge of the Linux terminal... SFML, Qt and CEF are good to consider

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.