This is a simple Node.js HTTP server that utilizes yt-dlp and mpv to stream YouTube videos. It's designed to be run inside a Docker container, with the video and audio playing on the host machine.
- Clone this repository:
git clone https://github.com/pipelinedave/youtube-send-to-mpv.git
- Navigate to the repository directory:
cd youtube-mpv-server
- Build the Docker image:
docker build -t youtube-mpv-server .
- Start the Docker container with the
docker-compose.yml
file:docker-compose up
- Open
http://localhost:3000
in your web browser - Enter a valid YouTube video URL and click the "Play" button to start playing the video
The Script in qutebrowser/userscripts can be used to add a function of sending the current video to mpv. Place the script in your qutebrowser userscript directory, usually ~/.local/share/qutebrowser/userscripts. Make sure it is executable. Add a bind to calling the script to qutebrowser like this: :bind yt spawn --userscript youtube-to-mpv.sh Play a video, run :yt and watch it open in mpv!
The scripts in tampermonkey.js
can be used to add a variety of functions to YouTube.
To use them, install the Tampermonkey extension from your local extension vendor _.
This Tampermonkey script adds a button to the YouTube video page that sends the current video to a local MPV container for downloading and playing with yt-dlp and mpv respectively. To use the script, simply click the "Send to MPV" button after installing the script. Note that you need to have the local MPV container running for this script to work.
This Tampermonkey script adds a "Send to MPV" button to every video link on the YouTube video overview page. When clicked, the script sends the video link to a local MPV container for downloading and playing with yt-dlp and mpv respectively. To use the script, simply click the "Send to MPV" button after installing the script. Note that you need to have the local MPV container running for this script to work.
To avoid having to rely on Tampermonkey, a Chrome extension has been created based on the tampermonkey.js
script. To install the extension:
1. Clone this repository: `git clone https://github.com/pipelinedave/youtube-send-to-mpv.git`
- Navigate to the
chrome-extension
directory:cd youtube-mpv-server/chrome-extension
- Open Google Chrome and navigate to
chrome://extensions
- Enable "Developer mode" in the top right corner
- Click "Load unpacked" and select the
chrome-extension
directory - Visit a YouTube video page to see the "Play with MPV" button