Awesome
mpvf
<img src="https://raw.githubusercontent.com/purarue/mpvf/master/.github/demo.gif">Interface to select a youtube-dl
format for streaming stuff with mpv
.
If you select a format with video only, automatically adds 'bestaudio' to the format.
Usage: mpvf URL [OPTION]...
Interface to select a youtube-dl format for streaming stuff with mpv.
Pass the URL to stream from as the first argument.
Additional options/arguments are passed onto mpv.
You can set the MPVF_DL environment variable to download
the selected format code instead, like:
MPVF_DL=1 mpvf https://... [youtube-dl OPTION...]
You can set the MPVF_PICKER
environment variable to use dmenu
/rofi
instead of fzf
:
export MPVF_PICKER=rofi
mpvf 'https://...'
export MPVF_PICKER=dmenu
mpvf 'https://...'
Installation
Dependencies: mpv
, youtube-dl
, fzf
(or specify dmenu
/rofi
as alternative)
Install each dependency if not already installed and then download/copy mpvf
to somewhere on your $PATH
Could also use basher
:
basher install purarue/mpvf
Notes
If you want to stream just the audio, you can select the audio format, or pass the --no-video
mpv
flag.
I've further wrapped this script as well:
- bound to different keybinds:
- grab URL from my clipboard and stream using
mpvf
- or, grab the URL and just stream audio
- or, grab the URL and stream video, stickying the video in the bottom right of the screen ('picture in picture'-like), using this
- have other related variations; to grab the URL and stream at different resolutions, often called from my RSS reader
- grab URL from my clipboard and stream using
twitch
: streams a twitch stream usingmpvf
. See this blog post for more context.mediaproxyvideo
: mostly a copy ofmpvf
, which prompts me to select a format,ssh
's onto my server,youtube-dl
/ffmpeg
's that video onto my server, and copies the public link its hosted on onto my clipboard.
Manual Install
wget https://github.com/purarue/mpvf/raw/refs/heads/master/mpvf
chmod +x ./mpvf
sudo mv ./mpvf /usr/bin/