An addon for ASB player that modifies subtitles based on your registered Anki knowledge
Install the ASB Player browser extension Install Python Download this repository Install the AnkiConnect plugin in Anki
pip install uvicorn
pip install fastapi
pip install pydantic
If you’ll use this for German, you’ll also have to install spacy
by doing pip install spacy
If you’ll use this for your Japanese studies, you’ll also have to install nagisa
by running pip install nagisa
Change the following settings in main.py to choose a language:
# MODIFY THIS
LANGUAGE = "ja" # "ja" for Japanese, "de" for German
FETCH_ANKI = True # if enabled, will search for already present flashcards to determine if you already know a word or not
ANKI_CONNECT_URL = "http://127.0.0.1:8765"
# DO NOT MODIFY BELOW
...
Run
python main.py
Open your favourite website supported by ASB player, then copy the code located in the file main.min.js and paste it in the console (you can open it using right click-> inspect or just press F12).
Go to https://subs.morisinc.net/install.html and follow the on-screen instructions. This will lead to the creation of a bookmarklet.
Enjoy
The app should automatically modify the subtitles on the fly. To modify settings, move your mouse to the top right corner of the page; a cog button will appear. Clicking on it will open the settings menu. The settings are saved on each website separately. Changing streaming websites will lead to loss of settings.
The python script may crash with the following message: No valid cards found, maybe you have selected the wrong deck?
. To resolve this problem, you may want to select the correct flashcard deck in anki (the selected deck will automatically be highlighted). The japanese variant of intelligent-subtitles
only supports Core 2K/6K for now (tested deck: Core 2k/6k Optimized JP Vocab (JouzuJuls)
).
The python script may crash unexpectedly on startup; if so, check if you have already opened Anki and that AnkiConnect is running.
The definitions may take a really long time to load if you have a poor connection.
In the /languages folder, you’ll find examples like de.py and ja.py
Each of these files must contain a LANGUAGE_TOKENIZE
function which will be called to tokenize a phrase and will return pairs of words and their respective POS (i.e. Noun, Adjective…).
They also must contain LANGUAGE_TRANSLATE
that will fetch a dictionnary of your choice for the language and return the definition.
MIT License
Copyright (c) 2024 Adrian Vlasov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.