A bookmarker menu to manage all your bookmarks in MPV. This script is based on mpv-bookmarker and has been rewritten to include a bookmarker menu. All of the code has been written from scratch, aside from the general file/JSON management utilities.
Notice: Bookmarks created with mpv-bookmarker can be loaded by this script and will be automatically converted. However, the bookmarks created with this script are not compatible with those created with mpv-bookmarker.
DEL
button now deletes the character after the cursor instead of clearing the whole string;
to a bold and yellow |
Copy bookmarker-menu.lua
to the scripts folder for mpv then add the following lines to input.conf
:
B script_message bookmarker-menu
b script_message bookmarker-quick-save
ctrl+b script_message bookmarker-quick-load
The keys are only a suggestion, and can be changed to something else.
Open bookmarker-menu.lua
in a text editor, and you can easily change these settings:
-- Maximum number of characters for bookmark name
local maxChar = 100
-- Number of bookmarks to be displayed per page
local bookmarksPerPage = 10
-- Whether to close the Bookmarker menu after loading a bookmark
local closeAfterLoad = true
-- Whether to close the Bookmarker menu after replacing a bookmark
local closeAfterReplace = true
-- Whether to ask for confirmation to replace a bookmark (Uses the Typer for confirmation)
local confirmReplace = false
-- Whether to ask for confirmation to delete a bookmark (Uses the Typer for confirmation)
local confirmDelete = false
-- The rate (in seconds) at which the bookmarker needs to refresh its interface; lower is more frequent
local rate = 1.5
-- The filename for the bookmarks file
local bookmarkerName = "bookmarker.json"
It's recommended not to touch bookmarkerName
but it's there to be changed in case you already have a file called bookmarker.json
and don't want that to be overwritten, or to change it to bookmarks.json
to convert bookmarks created by mpv-bookmarker.
B
or whichever key you configured in input.conf
: Pull up the Bookmarker menub
or whichever key you configured in input.conf
: Quickly add a new bookmarkctrl+b
or whichever key you configured in input.conf
: Quickly load the latest bookmarkB
or whichever key you configured in input.conf
: Close the Bookmarker menuESC
: Close the Bookmarker menuUP/DOWN
: Navigate through the bookmarks on the current page (Hold to quickly scroll)LEFT/RIGHT
: Navigate through pages of bookmarks (Hold to quickly scroll)ENTER
: Load the currently selected bookmarkDELETE
: Delete the currently selected bookmarks
: Save a bookmark of the current media file and positionshift+s
: Save a bookmark of the current media file and position (shows a text input, allowing you to type)p
: Replace the currently selected bookmark with the current media file and positionr
: Rename the currently selected bookmark (shows a text input, allowing you to type)f
: Change the filepath of the currently selected bookmark (shows a text input, allowing you to type)m
: Move the currently selected bookmarkReplacing a bookmark is intended for when you have a bookmark for your current progress in a TV series. When you've finished a new episode, you can select this bookmark and press p
to instantly rewrite that bookmark with your current progress, leaving the name and its position in the list of bookmarks intact.
Changing the filepath of a bookmark is intended to quickly change a bookmark in case you moved the media file to a different folder, or perhaps the drive letter of your external drive changed.
The Typer (as I named it) allows you to type text for various ends, like renaming a bookmark or changing its filepath.
ESC
: Cancel text input and return to the Bookmarker menuENTER
: Confirm text input and save/rename the bookmarkLEFT/RIGHT
: Move the cursor through the text, allowing you to input text in different places (Hold to quickly scroll)BACKSPACE
: Remove the character preceding the cursor (Hold to rapidly remove multiple)DELETE
: Remove the character after the cursor (Hold to rapidly remove multiple)Any text character
: Type for the text input. Allows special characters, spaces, numbers. Does not allow letters with accents (Hold to rapidly add characters)During text input for a bookmark's name, you can write %t
or %p
to input a timestamp in the name. (Note: This does not work for a bookmark's filepath.)
%t
is a timestamp in the format of hh:mm:ss.mmm%p
is a timestamp in the format of S.mmmFor example, Awesome moment @ %t
will show up as Awesome moment @ 00:13:41.673
in the menu
ESC
: Cancel moving and return to the Bookmarker menuENTER
: Confirm moving the bookmarkm
: Confirm moving the bookmarks
: Save a bookmark of the current file and positionUP/DOWN
: Navigate through the bookmarks on the current page (Hold to quickly scroll)LEFT/RIGHT
: Navigate through pages of bookmarks (Hold to quickly scroll)This has been tested on Windows. In theory, it should also work for Unix systems, but it hasn't been tested on those.
DEL
button now deletes the character after the cursor instead of clearing the whole string;
to a bold and yellow |
media-title
instead of filename
%t
or %p
for the bookmark name and have it expand into the time or position respectively