Skip to content

archusXIV/mpv-playlists-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

can be launch also from 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:

  • Fixed bug in _IfDuplicateFiles function when removing files extensions.
  • Added _IfDuplicatesFiles functon to check if we want to download already existing files in our destination folders.
  • Fixed bug in _QueueMultipleDirs function showing files instead of directories only.

Recent additions

  • 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 (stop mpv by typing Q),
# 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>"

screenshot

Integrated programs settings in mpmrc file

  • 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

Wmctrl settings

For a better experience I recommend a minimum terminal size of 1260x738 because of the youtube-dl outputs that let you choose desired audio/video formats, if you want an automatic terminal resizing just install wmctrl an the script will take care of that for you. If you're a tiling window manager user, make it float or give it more room in the stack.

wmctrl -r :ACTIVE: -e 5,-1,-1,1260,738
        -----------   -- -- -- --- ---
             |         | |  |   |   |---> Window height
             |         | |  |   |-------> Window width             
             |         | |  |-----------> Window Y coordinates
             |         | |--------------> Window X coordinates
             |         |----------------> Gravity
             |--------------------------> Apply to the active window

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.

Dependencies

Optionals

(recommanded for better experience)

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

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.

Releases

No releases published

Packages

No packages published

Languages