mpv script to download japanese subtitles for anime. Both filename and title are parsed to obtain anime title and episode, this information is used to find subtitles on jimaku (or kitsunekko as a fallback). If the file chosen is compressed, the script will try to extract its contents. Once the subtitle file is downloaded, it will be automatically loaded on mpv for the current file to use.
animeSubs_dl_demo.mov
Locate your mpv config folder. It is typically found at ~/.config/mpv/ on Linux/MacOS and C:\users\USERNAME\AppData\Roaming\mpv\ on Windows. Files section in mpv's manual for more info. I will refer to the path of this folder as <mpv config directory> for the rest of this file.
To install the mpv script you can use the precompiled binaries without having to install anything else. Otherwise you can setup a python environent to run the script. Binaries have not been thoroughly tested, open an Issue if you encounter any problem.
-
Download the build version matching your system from the Release page and extract its contents
-
Place the
animeSubs_dlfolder inside thescriptsfolder in<mpv config directory>. If it doesn't exist you should create it. -
If you are on macOS you may need to run the following command in Terminal to allow the system to run the sctipt since it is not signed:
xattr -dr com.apple.quarantine ~/.config/mpv/scripts/animeSubs_dl/bin
Running the script for the first time might take a while so if nothing seems to happen just wait. Afterwards it should start almost instantly.
-
Download the source code from Release section.
-
Place the
animeSubs_dlfolder inside thescriptsfolder in<mpv config directory>. If it doesn't exist you should create it.
If you don't already have python 3.10 or above installed on your machine, install it. On Windows make sure python is added to PATH.
Optional: Create and activate a virtual environment named
.mpv_venvin<mpv config directory>. While optional, it is highly reccomended to keep the script isolated from the system python.If you chose a different name for the virtual environment or you want to use a different version of pyhton, open
main.luain a text editor and set thecustom_python_cmdvariable to a string containing your preferred command or path to binary.
Install dependencies (substitute / with \ if you are on Windows)
cd <mpv config directory>
cd scripts/animeSubs_dl
pip install -r requirement.txt
On mpv, use the keybinding CTRL+SHIFT+j to start the script and then follow the instruction on screen to select the correct file.
If you are playing a local file, the subtitles file will be placed in a folder named after the parsed anime title and placed in the same directory as your local file. If you are streaming a file, the subtitles will be downloaded into the mpv_subs folder automatically created in your HOME directory.
To change the keybinding add the following line to your input.conf file after replacing CTRL+J with whatever you prefer
# animeSubs_dl
Ctrl+J script-binding animeSubs_dl/auto_download_subs
NOTE: If you are not using the standard mpv build, your player might ignore the
input.conffile (e.g. mpv.net, IINA) so you might need to use the in-app options to set the keybindings.
| Name | LICENSE |
|---|---|
| aniparse | Mozilla Public License 2.0 (MPL 2.0) |
| beautifulsoup4 | MIT License |
| py7zr | LGPL-2.1-or-later |
| python-mpv-jsonipc (TnTora) forked from python-mpv-jsonipc (iwalton3) |
Apache-2.0 |
| requests | Apache-2.0 |
Binaries are compiled using Nuitka.