An opinionated rewrite of umpv and umpv-go in Lua.
This script emulates "unique application" functionality. When starting playback with this script, it will try to reuse an already running instance of mpv (but only if that was started with umpv). Other mpv instances (not started by umpv) are ignored, and the script doesn't know about them.
The point of this rewrite is to remove any forced options (to return control to the user without modifying the script) while also allowing extensibility (removing the "Custom options can't be used" limitation from umpv).
For example, umpv forces profile=builtin-pseudo-gui, umpv-go forces either force-window=yes or
force-minimized=yes depending on the value of the --foreground flag, which has now been removed not only because of
this functionality but because it can't be cleanly implemented for non-Windows operating systems.
All options should be controlled by the user, whether that be through their mpv.conf or the flags they specify in the
command line.
You will need luvi compiled with luajit
luvi . -o umpv --strip # umpv.exe on WindowsAll flags designated after -- will be passed to mpv.
The IPC socket path to connect to. Default path is \\.\pipe\umpv on Windows and
$($UMPV_SOCKET_DIR || $XDG_RUNTIME_DIR || $HOME || $TMPDIR)/.umpv on everything else.
How files should be added to mpv's playlist. Supported values are:
replace: Replace the playlistappend: Append to the playlistappend-play: If nothing is playing, play the file, otherwise append to the playlist (default)insert-next: Add to the playlist after current iteminsert-next-play: If nothing is playing, play the file, otherwise add to the playlist after current item
Load this specific file as umpv.conf instead of the one found in mpv's config directory or next to the executable.
Keeps the umpv process lingering. This can be used to trick streamlink
without having to use --player-external-http.
umpv file_or_urlumpv -- --force-media-title="some title" file_or_urlset mpv_args=--loadfile-flag=replace --ipc-server=\\.\pipe\umpv-file -- --idle=yes --resume-playback=no --save-position-on-quit=no
set mpv_path=%userprofile%\.local\bin\umpv.exeWarning
streamlink defaults to stdin which will not work! Use either --player-fifo or --player-http.
Note
streamlink has a strict regex check for ^mpv$, --title and {playertitleargs} will have no effect and only show
the pipe name or the URL as the title depending on which player type is used.
streamlink --player-fifo -p umpv -a "--keep-process=yes --" url best