Skip to content

Latest commit

 

History

History
167 lines (132 loc) · 7.9 KB

README.md

File metadata and controls

167 lines (132 loc) · 7.9 KB

mpv-playlists-manager

Manage playlists for mpv from your linux terminal

About mpm

Manage playlists that mpv reads either online or from local files/directories, youtube-dl/yt-dlp is used to download videos or just audio and in that case if we choose webm links, ffmpeg will (if you want to) convert them in five different formats: aac, flac, mp3, ogg, or wav. You can switch encoders by editing the config file (mpmrc), and many more options to control mpv, ffmpeg, yt-dlp and download/playlists directories etc...

Please read it before first run and change settings to your likings.

Youtube dedicated channel

Installation

Run the install.sh script as root, by default /usr/local/bin /usr/local/lib are the respective destinations. The install script will detect if mpm is already installed and in that case the prompt will be: [R]emove or [U]pgrade mpm?

Otherwise the simple install function will run and create ~/.config/mpm/{mpmrc,themerc} files.

git clone https://github.com/archusXIV/mpv-playlists-manager.git
cd mpv-playlists-manager
chmod +x install.sh
sudo ./install.sh

Dependencies

Optionals

(recommanded for better experience)

mpm can be launched also with these commands:

mpm -c|--config   # edit mpm config
mpm -e|--edit <?> # edit a playlist from a list; or with an argument:
                    mpm --edit <myPlaylistName> (no extension suffix).
mpm -h|--help     # launches less /usr/local/share/doc/mpm/help
mpm -l|--load <?> # launches the play/download function; or with an argument:
                    mpm --load <myPlaylistName> (no extension suffix).
mpm -f|--local    # load local files/folder(s)
mpm -v|--version  # prints mpm version

Please update your mpmrc file on each release

When upgrading mpm, a ~/.config/mpm/mpmrc.diff will be created and merged with your mpmrc file, of course a backup will be generated under mpmrc.orig. Remember some of the changes are crucial... To launch mpm faster, in your ~/.{bashrc,zshrc} add:

source ~/.config/mpm/mpmrc
source ~/.config/mpm/themerc

Changelog:

  • Added a native mpv tui to replace ncmpvc as the default player for any kind of playlist that we want to pass to mpv, see help or bindings to control your playlist inside this fzf "player".
  • If use_fzf is set to yes and fzf is installed, loading/editing/removing playlists is done through a fzf menu to select which collection playlist to act on.
  • Fixed bug in _MvpOwnsTmplist when tmp_dir/mpv.pid exist.
  • Refactored _SearchYoutubeWithFzf function to take into account the number of queries defined as the ytdlPreset_NR array in the user configuration file.
  • We don't need wmctrl anymore, the window size is expressed as columns and lines.
  • Added a red prompt when in the [E]dit titles option the user deleted lines instead of editing.

Mpv interfaces

  • Mpv terminal user interface can be used to pick & choose playlist items while mpv is running.

    Such as:

    as usual set it in your mpmrc file.

# experimental
# can be yes (mpvc tui) no (control mpv using shortcuts, press B for details),
# or empty (mpv infos in the terminal).
use_mpvc="no"
# change your mpv Terminal User Interface here
# mpvc_tui="ncmpvc"
mpvc_tui="<your_mpv_tui_here>"
  • Or...
# Colors can be change in ~/.config/mpm/themerc.
mpvc_tui="native"

screenshot

Integrated programs settings in mpmrc file

  • I also provide a new script (somabox) to listen to somafm.com radio stations through option 5). Place it in your $PATH, and change mpmrc setting to 'yes'
use_somabox="yes"

screenshot

  • As mentioned above mpv command line tools and terminal interface.
  • ffmpeg, mpv, ytfzf & yt-dlp options can be set in your mpmrc through their respective bash arrays.
  • Audio & Videos directories are defined in your mpmrc file (change them according to your locales).

Using fzf

  • Two methods are offered here:

    • If the fzf package is installed it will be used to search and copy audio/video urls from youtube, and to queue up local files.
    • In addition you can also use the ytfzf script if it is in your $PATH, options are available in the mpmrc file.
  • In your mpmrc file activate it.

use_fzf="yes"

Audio conversion done faster with parallel

  • If installed, parallel will launch multiple ffmpeg instances to speed up audio conversion.
  • Just enable it in your mpmrc file
use_parallel="yes"
  • If not installed then we'll use xargs -P (number of process) {} ffmpeg....which is also fast, otherwise ffmpeg treat files one by one. Make sure parallel_conversion is set to yes in your mpmrc file.
parallel_conversion="yes"

Themes

  • A themerc file is available to insert as many as you want "themes" instead of bloating up your mpmrc.

default theme will use your ~/.Xresources colors or your terminal preferences.

  • When in mpmrc $mpvc_tui is empty, we can use hjkl keys in the main window for mpv control.

screenshot

# edit your own theme in "$XDG_CONFIG_HOME"/mpm/themerc.
# apply your prefered colorscheme...
# AVAILABLE THEMES: default, blacksea, dracula, gruvbox, gotham, jellybeans,
# monokai, pistachio, nord, TokyoNight, solarized, vacuous, zenburn, zorange
THEME="default"
  • To find out how to convert hex colors in rgb colors, open your prefered color picker and look at "red green blue" fields.

screenshot

More screenshots here

Why ranger file manager?

(it can be any terminal file manager) Because we are terminal users so we can navigate across our local media files. You will also need some dependencies to make it functional, for example displaying image/video thumbnails preview with ffmpegthumbnailer. Make sure $XDG_CONFIG_HOME/ranger/scope.sh is executable.

FILEMANAGER="ranger"

Requests and contributions? Why not, have fun.

Credits

I would like to thanks all the devs that put their great work in the softwares I use and that I have implemented in this project and especially mister Brian Jhan Fox the father of the Bourne-Again SHell, even if I don't always use it the right way.