July 25

0 comments

Turn Japanese YouTube Subtitles Into Anki Flashcards

By Charles Hoshino

July 25, 2020


One of my favorite ways to easily make Japanese Anki cards for language study is to turn video subtitles into SRS flashcards. For anime, film, and TV shows, you can use an app like subs2srs to automatically generate flashcards from subtitle files. But what about for YouTube? Can you turn Japanese YouTube subtitles into Anki flashcards without the hassle of downloading files manually?

In this post, we’ll look at a workflow to easily grab transcripts from YouTube and turn them into subtitle flashcards for Anki. It does take some time at first, but the workflow is very fast once you finish the initial setup.

Here is the simple workflow:

  • Install Daniel Doblado’s youtube2Anki extension for either Chrome or Firefox
  • Search for videos with accurate Japanese subtitles
  • Import the cards into Anki (either as a CSV or directly with AnkiConnect)
  • Update the cards and do some weeding if necessary

Let’s look at each of these steps in detail.

Install the Chrome / Firefox extension

Though there have been extensions in the past that let you make YouTube subtitles into SRS flashcards, they were unwieldy and required you to download the video. Doblado’s youtube2Anki extension lets you make the cards straight from your browser.

The Github repo that I linked to has links to the browser extensions. Install the one for the browser that you prefer.

links

Filter YouTube for videos with Japanese subtitles

Once you have the extension installed, you’ll want to find videos with high-quality Japanese subtitles. This can be easily done within YouTube. Just click the “Filter” button and select “Subtitles/CC”. This will limit results to videos that have subtitles.

ytfilter

You can also optionally add a filter for videos that are longer than 20 minutes. This gives you more subtitles per video.

A search for アニメ  (anime) gave me a ton of hits:

msedge_yOEoCvKQRu

All of these videos have subtitles, but be aware that not all of the subtitles are in Japanese. There is no way currently to filter for only videos that have Japanese captions, so you’ll have to find a video manually.

Also, some videos have AI-generated Japanese captions. These are unreliable, so you’ll want to avoid videos that have these. It may take some trial-and-error before you find some good keywords that return videos with good subtitles.

Grab the transcript from YouTube

Now that we have a video, it’s time to use the extension! Before you can do so, you’ll first need to click “Open transcript.” This is because YouTube does not generate the transcript until you click the button.

opent

Once you have the transcript ready, you can click the extension and either (a) directly send the cards to Anki via AnkiConnect or (b) download a CSV file you can import. You can see a sample CSV file from the above video here. For those that do not know, a CSV file is kind of like an Excel file that stores rows of data in a text file.

The AnkiConnect sync did not work on my computer, so I opted to import from a CSV file. If you want to import a CSV, you’ll first have to do some setup in Anki. We need to teach Anki how to map the values in our file to new flashcards.

Set up Anki for subtitle import

If you are importing from CSV, the initial setup can take a few minutes. However, you only need to do it once. The detailed instructions are in Dobladov’s repository, but here is the basic outline of what you need to do:

  • Add a new note type in Anki that you will use for YouTube subtitle cards
  • Add fields to the card so that each field corresponds to a column in your CSV file
  • Edit the template of the card

That’s it. Dobladov has code you can copy and paste in his repository. Assuming you follow the instructions well, you should be ready to go in just a few minutes.

Import the CSV subtitles into Anki

After you have set up Anki to accept the new note type, you can easily import a CSV by selecting File -> Import:

vlvhl6FL0d

Make sure you select the correct deck to import into! You wouldn’t want to import Japanese  flashcards into your deck for human anatomy or computer science.

After importing, you should get cards like these:

Y5PK5oSSYQ

I’m currently learning Korean, so the gif shows a card from a Korean video I downloaded from YouTube.

Notice how the card has the YouTube video embedded inside of it. This means you don’t have to save any pictures or videos on your computer. When you click play, it will automatically play video for only the length of the subtitle.

Filter and edit your subtitle cards

ughh
Looks cool… but it’s not exactly SRS-worthy material

Although we are almost done, there are two more things we need to do to complete our YouTube flashcards. Both of these can be done while reviewing:

  • Add a backside to our cards. Right now, we only have the “front” of our flashcards. You will want to add dictionary definitions, translations, reference material, etc. to the back of the card. Just do whatever you do for your other Anki flashcards!
    • Another option that requires some coding ability would be to also download the English subtitles for whatever video you are using and place those into the back of the card. That way you get translations on the back.
  • Delete bad cards. Not all subtitles will be useful for Japanese learners. You will also get a lot of cards with phrases like AUGHHHH! or WAHHHH!, which are funny but not needed in your sentence deck. I suggest you get familiar with the “delete card” shortcut on Anki (it’s ctrl+del on Windows). Whenever you see a card you don’t want to keep, just delete it. You may find that you are deleting over half of the subtitle cards!
    • Note: You can also do this before you import the CSV file but manually going through and deleting rows you don’t want. This adds an extra step to the process, though, so I don’t like it.

That’s it! Use this workflow to transform YouTube subtitles into Anki flashcards. If you liked this, you might also want to see our guides on how to make Anki cards from visual novels and how to make Anki cards from manga.

Leave a Repl​​​​​y

Your email address will not be published. Required fields are marked

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}