Chrome extension and Firefox add-on that adds context menu option to play youtube videos with mpv (or other external player).
- Chrome like/Firefox browser.
- python2 or python3
- youtube_dl module
- mpv or similar
./install-ubuntu.sh
make sure you don't run this script as root (without sudo)
- chrome://extensions/
- tick Developer mode
- Load unpacked extension...
- Choose chrome directory of this project.
- Navigate to script's directory.
- Run
python ytdl_server.py
.
Modify ytdl_config.py
file.
General (mpv) player options should be set (usually) in
~/.config/mpv/config
. Specific options like provided
--no-terminal
should be put in OPTS
variable and
separated with space ie: --no-terminal --screen 1
.
Whenever 'Play with mpv' is selected in browser,
url http://127.0.0.1:9000/p?i=<youtube_url>
is
sent to listening server. Server checks if url is
supported, extracts video url and starts player.