Setup: Everything Else
Overview¶
This page is dedicated to providing resources on how to do the following:
- Getting the actual text to use Yomichan on.
- Getting the pictures and/or sentence audio from the media.
There are plenty of well established resources out there on how to do just that, ranging from software to written & video guides. Instead of repeating what others have already said, those programs and guides will be linked.
If you are looking to setup jp-mining-note, see this page instead.
Note
If you already have a sentence mining workflow, you can likely skip to this section.
Troubleshooting & Support¶
If you are having troubles with any of the guides or programs below, I unfortunately will not be able to provide very detailed support.
Instead, I would recommend that you contact the creators of the guides / programs, or the communities surrounding said guides / programs.
Additionally, the guides listed here usually do not use JPMN, and instead link to other note types. This shouldn't be an issue as long as you change the appropriate the field names.
Getting the Text to Create the Cards¶
I use a texthooker setup, which is able to extract subtitles or text into the browser. Once the text is on the browser, you can use Yomichan to select the word and create the Anki card (by clicking on the green plus button).
The standard texthooker setup works for most games, and any show with subtitle files.
Texthooker: Websocket based¶
These pages display the hooked content, where the hooked content is communicated via Websockets. Websocket based texthookers are better than the classic clipboard-based texthookers in almost every aspect:
- They are generally faster and more reliable.
- They do not flood your clipboard.
- They do not require an extension that constantly polls the clipboard.
However, it requires more specialized coordination between programs.
Resources (click here)
-
Renji's Texthooker Page (recommended)
- I use these settings to make the text more compressed.
- This texthooker page comes with built in support for both websockets and clipboard inserter plugins.
-
exSTATic (recommended for stats lovers)
- Its primary use is for automatic stats collection and visualizing said statistics.
- Integrates seamlessly with many workflows.
- Uses a custom texthooker page, which connects with Textractor with its own custom extension.
- A video installation guide is available on the project's README page.
Supported Workflows:
- Textractor with textractor-websocket or TextractorSender
- mpv with mpv_websocket
Legacy Resources (click here)
These resources are considered legacy, and I highly recommend using the standard resources above in favor of these.
-
- A more featureful version of the patch below.
- Written for Anacreon's texthooker page.
-
Zetta's Custom Patch
- Patch Instructions for existing clipboard-based texthookers.
- This patch is intended to be used in conjunction with this Textractor extension.
- This patch was written for Anacreon's texthooker page. However, it will likely work for most other texthooker pages.
Instructions to use the patch (click here)
Warning
This is a monkey patch, even according to the author. Now that better alternatives have came out (see above), I recommend to use said alternatives.
- Download your favorite texthooker page into a raw html file.
- Copy/paste the code below to the very end of the raw html file.
- If you are currently viewing the page, refresh.
(Original discord message, on TMW server. Thanks Zetta#3033 for the code.)<script> let socket = null; let wsStatusElem = null; const createStatusElem = () => { wsStatusElem = document.createElement("span") let node = document.getElementById('menu').firstChild wsStatusElem.setAttribute("class", "menuitem") wsStatusElem.addEventListener('click', (e) => { if(wsStatusElem.innerText == "Reconnect") { connect() } }) node.insertBefore(wsStatusElem, node.firstChild) } const updateStatus = (connected) => { if(wsStatusElem === null) { createStatusElem() } wsStatusElem.innerText = connected ? "Connected" : "Reconnect" wsStatusElem.style.cssText = "margin-right: 1.5em; display: inline-block;" wsStatusElem.style.cssText += connected ? "color:rgb(24, 255, 24);" : "color:rgb(255, 24, 24);" } const connect = () => { socket = new WebSocket("ws://localhost:6677/") socket.onopen = (e) => { updateStatus(true) } socket.onclose = (e) => { updateStatus(false) } socket.onerror = (e) => { updateStatus(false); console.log(`[error] ${e.message}`) } socket.onmessage = (e) => { let container = document.getElementById('textlog') let textNode = document.createElement("p") textNode.innerText = e.data document.body.insertBefore(textNode, null) } } connect() </script>
Texthooker: Clipboard based¶
These pages display the hooked content, where the hooked content is communicated via automated clipboard (copy/paste) tools. Most classic setups documented are for clipboard based texthooker pages.
Resources (click here)
- Original Clipboard Inserter (Extension) (Chromium-based browsers)
- WARNING: No longer works on Firefox as of Firefox version 107.0. Use the extension below if you are using Firefox.
- Lap Clipboard Inserter (Extension) (Firefox)
- Updated version of the above.
- Works on Firefox, but Chrome (manifest 3) support is currently not supported. Use the first extension if you are using a chromium based browser.
- Renji's Texthooker Page (recommended)
- Open source and more featureful alternative to the more popular Anacreon's texthooker page.
- I use these settings to make the text more compressed.
- Anacreon's Texthooker Page
- TMW's Texthooker Page
Guides (click here)
Game-Like Content: Getting Text¶
The following are primarily for text-heavy games, such as visual novels.
Resources (click here)
- Textractor (recommended)
- agent
- This is a good fallback for when Textractor doesn't work
Guides (click here)
- TMW: Installing Visual Novels
- TMW: Texthooker & Visual Novels
- Anime Cards: Texthooker & Visual Novels (slightly outdated compared to others)
- Lazy Guide: Playing Visual Novels on Mobile
- Playing Emulated DS, 3DS, PSP and Gameboy Advanced games on Android devices
- Contact info:
OrangeLightX#2907
on the Refold (JP) Discord server or TMW server
- Contact info:
- See this section to get sentence audio and images
Video Content: Getting Text, Sentence Audio, Picture¶
Video content includes streamed content (Youtube, Netflix, etc.) and locally downloaded files.
Resources (click here)
- mpvacious (recommended for downloaded videos / if you are using mpv)
- Add-on for MPV, a cross platform media player. Personally tested.
- Basically universal codec support since it uses mpv.
- This addon has capabilities to extract the video clip itself as the form of a gif (autoplayable webp).
- asbplayer (recommended for streamed sites)
- Cross platform (chromium) browser video player. Personally tested.
- Codec support is based on the browser used.
- Works on video streaming sites, as well as downloaded videos.
- Animebook
- Cross platform (chromium) browser video player.
- Codec support is based on the browser used.
- All of the above require subtitle files to function. See here and/or here for some websites where you can get subtitles from.
- One challenge for video content is that subtitles are usually not aligned properly
if the subtitles are downloaded separately from the video.
I've always used a combination of
mkvextract
(to extract the subtitle file from the
.mkv
file) and alass (to align the native subtitles with reference subtitles, usually in a different language) to get the job done. If you want more options, see this page.
Other:
- jidoujisho
- Android e-book reader and media player. Advertises itself as an all-in-one app.
- See this note on jidoujisho.
- Immersive
- Add-on for MPV. Alternative to mpvacious.
- WARNING: This is potentially outdated and/or abandoned. The most recent commit as of writing (2022/10/19) was done in 2022/01/27. This is listed here for completeness only.
Guides (click here)
- mikumino's mining workflow (asbplayer + jp-mining-note)
- Shiki's mining workflow (asbplayer)
- Contact info:
boundary-of-emptiness#3065
on the Refold (JP) Discord server
- Contact info:
- Tigy01's mining workflow (asbplayer)
- Contact info:
Tigy01#1231
on the Refold (JP) Discord server
- Contact info:
- Cade's sentence mining guide (animebook)
- Contact info:
eminent#8189
on Perdition's server or TMW server
- Contact info:
Manga: Getting Text¶
mokuro (recommended)
mokuro pre-processes manga, so you don't have to run any OCR program afterwards.
Guides:
- Lazy guide (recommended)
- (For Windows users) Make sure to check the "Add Python to Path" on install.
- If you are using online processing (google colab), be sure that you are using the gpu to speed up the process.
- Josuke's mokuro setup guide
- Contact info:
Josuke#7212
on the Refold (JP) Discord server - This doesn't include instructions on how to process online (whereas the Lazy guide does)
- Contact info:
Other Resources:
- If you are on Android, this can be paired with Anki Connect for Android to create Anki cards.
- WeebAlt's RemoteMokuro setup
- This includes setup instructions on using Mokuro remotely (from google drive, i.e. no disk storage)
If any error occurs, check the following:
-
Check your Python version (
python --version
, orpython3 --version
). Python 3.10 is not supported yet.If your Python version is too old, I recommend using pyenv (for Linux users). Linux users can use the automatic installer. For Windows users, it should be sufficient to uninstall
mokuro
, install a newer version of Python, and then re-install mokuro with the newer version. -
Make sure your directory is a string and not a number. For example,
mokuro ./01
on unix, andmokuro .\01
on Windows.
Manga OCR
Manga OCR allows you to automatically OCR any image. As the name suggests, this works best on manga.
Guides:
Books (EPUBs, HTMLZ, PDF)¶
As long as you're not using a scan (image-based), the text should already be available. Below will list a few ways to view these files in a browser to Yomichan.
Resources (click here)
- ッツ Ebook Reader (EPUBs, HTMLZ) (recommended)
- Mozilla's PDF Viewer (PDF)
Other:
- jidoujisho
- Android e-book reader and media player. Advertises itself as an all-in-one app.
- Uses ッツ Ebook Reader as its backend.
- See this note on jidoujisho.
Guides (click here)
- Like with Mokuro, if you are on Android, this can be paired with Anki Connect for Android to create Anki cards.
Getting Images & Sentence Audio Manually¶
Sometimes, there is no easy way to get the image and sentence audio other than with a screen recorder. The primary example for this is game-like content.
Here are the two popular approaches to automatically adding the image and sentence audio:
ShareX (Windows)
- Windows media recorder which can both take screenshots and record audio. Personally tested.
Guides:
- stegatxins0's mining guide: ShareX (recommended)
- The scripts written here works by default with this note. These scripts are meant used with stegatxins0's setup.
- Xeliu's mining guide: ShareX
- ShareX setup is based off of stegatxins0's setup
- Anime Cards: Handling Media
- Not recommended: introduces additional steps compared to the above two guides
ames (Linux)
- ShareX alternative for Linux. Personally tested.
- Primarily used to automate audio and picture extraction to the most recently added Anki card.
Resource Lists¶
Other websites have significantly larger resource lists that may prove useful for you.
Resource Lists (click here)
Notes on Various Programs¶
mpvacious¶
-
You will have to change the configuration in order for mpvacious to work with JPMN.
Click here to see some basic config changes to get it working with JPMN.
# Be sure to change deck_name to whatever your deck is! # Model names are listed in `Tools -> Manage note types` menu in Anki. model_name=JP Mining Note # Field names as they appear in the selected note type. # If you set `audio_field` or `image_field` empty, # the corresponding media file will not be created. sentence_field=Sentence #secondary_field=SentEng # Not used by the note. This is ignored entirely. audio_field=SentenceAudio image_field=Picture
You may want to increase the picture and audio quality, as it's extremely low by default. I personally use the following:
# Sane values are 16k-32k for opus, 64k-128k for mp3. audio_bitrate=32k # Quality of produced image files. 0 = lowest, 100=highest. #snapshot_quality=15 snapshot_quality=50 # Image dimensions # If either (but not both) of the width or height parameters is -2, # the value will be calculated preserving the aspect-ratio. #snapshot_width=-2 #snapshot_height=200 snapshot_width=800 snapshot_height=-2
Info
When creating the config file, ensure that the config file is placed in the correct folder. This
script-opts
folder does not exist by default. You will likely have to create the folder.Additionally, be sure to restart MPV after changing the config to apply the changes.
-
A common issue with mpvacious is that the
SentenceReading
field may differ from theSentence
field, say, if you export multiple subtitles into one card. See the FAQ on how to fix it. -
To create cards with mpvacious, first add a card from Yomichan (usually via a texthooker), and then press
ctrl
+m
in mpv.
asbplayer¶
-
To use asbplayer, add the card with Yomichan, and then update the created note with asbplayer. I recommend filling out the following fields as follows:
asbplayer fields (click here)
asbplayer field JPMN field Sentence Field Sentence
Definition Field Word Field Audio Field SentenceAudio
Image Field Picture
Source Field AdditionalNotes
URL Field AdditionalNotes
Note
Chances are that you are using subtitles. However, if you are not using subtitles, it is fine to keep the Sentence Field empty.
-
Any version of asbplayer released after 2023/01/16 (version 0.25.0 or higher) will now preserve the bolded word within the sentence! However, asbplayer shares the same common issue with mpvacious, where the
SentenceReading
field may differ from theSentence
field. See the FAQ on how to fix it.
jidoujisho¶
I'm not very sure how the Anki card generation works for this app, since this app does not use Yomichan.
The custom handlebars used by JPMN does a lot of heavy lifting and has plenty of customizations specifically to work JPMN. Unfortunately, this handlebars is not very portable between programs.
If you want to use this app, I leave it to the user to figure out the specifics of creating the cards.