A browser userscript that will allow you to open videos in external player mpv by simply clicking on a thumbnail.
It simply replaces video thumbnail hyperlinks on a page, changing their protocol from https:// to mpv://.
- YouTube
- Any modern web browser that supports extensions
- mpv media player
- yt-dlp
- Userscript manager, such as Violentmonkey, Greasemonkey or Tampermonkey
- Clone this repository
- Create a script in your browser userscript manager and paste contents of userscript.js from this repository
- Make sure the userscript is enabled
- Install mpv. make sure the mpv url handler was also registered with the system (this happens automatically on macos)
- Cookies are not passed in any way, hence private vidoes (subscriber only) won't play
Video urls are not updated on the page unless the url in the address bar changes. for example if you are choosing different categories using the buttons (chips) at the top of the main youtube page.
Tested and confirmed working in the following setups:
- GNU/Linux with Xorg, Mozilla Firefox, Violentmonkey
- Windows 32-bit, Chrome, Tampermonkey
- Windows 64-bit, Firefox, Violentmonkey
- Macos, any browser that supports extensions/userscripts