- Cross-platform: Windows, Mac and Linux
- Multi-language support
- Subtitle provider login support
No hotkeys required: opening a video will automatically trigger subtitles to download
(Only when the right subtitles are not yet present)
This Lua script uses the Python program
subliminal to download subtitles.
Make sure you have both installed:
pip install subliminal
Copy autosub.lua into:
cat > ~/.config/mpv/scripts/autosub.lua
[Paste script contents and CTRL+D]
Specify the correct subliminal location for your system:
To determine the correct path, use:
Copy this path to the subliminal variable at the start of the script:
local subliminal = '/path/to/your/subliminal'
On Windows, the backslashes in the path need to be escaped, e.g.:
- Optionally change the subtitle languages / ISO codes.
Be sure to put your preferred language at the top of the list.
If necessary, you can manually trigger downloading your first choice language by pressing
or your second choice language by pressing
- Optionally specify the login credentials for your preferred subtitle provider(s), if you have one.
- If you do not care for the automatic downloading functionality, and only wish to use the hotkeys,
simply change the
auto bool to
- For added convenience, you can specify the locations to exclude from auto-downloading subtitles, or alternatively,
the only locations that should auto-download subtitles.
This script is under the MIT License,
so you are free to modify and adapt this script to your needs:
check out the MPV Lua API for more information.
If you find yourself unable to find the correct subtitles for some niche movies/series,
you might be interested in the submod
command line tool I've written to manually correct subtitle timing.
Inspired by selsta's and
fullmetalsheep's autosub scripts.