Ditch plex/jellyfin/kodi (or worse Netflix)! My favorite mpv scripts

Published 2022-01-09 on Anjan's Homepage

mpv is my favorite video player. It has a lot of user scripts written in a variety of programming languages. Many people install jellyfin, plex, or kodi to emulate a netflix-like experience. Here’s how I am able to emulate a netflix-like experience with mpv using user scripts:


skiptofade.lua skips til a black screen appears. This allows you to skip intros to shows very easily by pressing a keybinding. The default keybinding to run this macro is b.


nextfile.lua allows you to open the next or previous file from the directory the video currently open. As such, when an episode finishes, you can press shift+RIGHT to go to the next episode.


When you close a video, history-bookmark.lua will save a .mpv.history file in the directory from which the video is located. Next time you open any file in that directory with mpv, history-bookmark.lua will prompt you to continue the last episode you watched from that directory. Pressing ENTER will jump to the last episode you watched in that directory, pressing n or doing nothing will resume the episode you originally opened. After adding save-position-on-quit to your mpv.conf and setting up a nfs share to share your media directory, you are able to sync your media watching history across devices.


webm.lua allows you to easily make webms using clips of stuff you are viewing via mpv. Press Shift+w to open up the onscreen instructions and activate the script’s keybindings. This script allows you to easily share funny clips of shows you are watching with your friends. webm.lua is the easiest webm generator I have used.


Putting save-position-on-quit in your mpv.conf only updates your “watch later” data when mpv closes. autosave.lua is a simple script that periodically updates your “watch later” data. It’s very useful in case mpv crashes, Xorg/wayland crashes, etc.

Firefox: openwith

mpv is the best video player and I always want to use it to watch videos. I use invidious to look browse videos without youtube’s bloated and privacy invading ui 1. The Firefox plugin: Open with allows you to easily open links with another browser. I have add “mpv” as an application I want to open links with so that I can take advantage of all the scripts above whenever I’m watching a video on the internet.

Opening videos with mpv is even easier in qutebrowser.

Remember to install yt-dlp, the successor to youtube-dl so that you can use mpv with most websites that serve video.

What are your favorite mpv scripts? Feel free to leave a comment in my public inbox!



You can setup links from youtube to automatically redirect to invidious using this plugin for Firefox or modifying this script for qutebrowser. If you are using the qutebrowser script, remember to load redirectors.py in your config.py using according to the logic here.

Have a comment on one of my posts? Start a discussion in my public inbox by sending an email to ~anjan/public-inbox@lists.sr.ht [mailing list etiquette]

Articles from blogs I follow around the net

These articles/blogs do not represent my own opinions or views.

Using a Linux phone as a secondary monitor

As a software developer on the go, one of the very first use cases that I started investigating after installing Linux on my first tablet was that of using a portable device as a secondary display for another Linux machine. Ideally, this would happen wire…

via TuxPhones - Linux phones, tablets and portable devices May 16, 2022

Status update, May 2022

This was an exciting month: the Hare programming language is a secret no more! You can now try out the programming language I first teased over a year ago and tell me what you think. I hope you like it! I’m quite pleased with it so far. One thing Hare has don…

via Drew DeVault's blog May 16, 2022

How to Build a Practical Household Bike Generator

We built a pedal-powered generator and controller, which is practical to use as an energy source and exercise machine in a household — and which you can integrate into a solar PV system. We provide detailed plans to build your own, using basic skills and …

via LOW←TECH MAGAZINE March 6, 2022

Generated by openring