Extracting Subtitles from Netflix

Updated 1/22/2018

Having subtitle scripts from TV shows that you are watching is an excellent study aid. Not to mention that they can be used with Subs2SRS to easily import sentences into Anki! These days, many people tend to watch Netflix more than a lot of the traditional media. I’ve also seen numerous people talking about how the Netflix Original “Terrace House” is great for Japanese listening practice, because it is unscripted and captures natural dialog.

When I originally wrote this post, it was because I had discovered a way of ripping Japanese subtitles from Netflix, which to my knowledge, no one else had figured out how to do at the time. My method was long and clunky though. Eventually, a user named ahlawy posted in the comments section with details for a new method which was far superiod to the one I had come up with. And shortly after that, TITHEN-FIRION posted a tool that he had created which can largely automate the process altogether. So now, it is really quite simple to rip subtitles from Netflix, to the point that just about anyone can do it.

Download Subtitles I’ve Already Ripped

All of the Japanese subtitles that I have ripped have been OCR’ed using the Google Cloud Vision API. This is likely the most accurate Japanese OCR technology available at the moment, but the text still does contain a few mistakes here and there. So please keep this in mind if you are using these subtitles to study. If something looks wrong, it probably is. Go watch it on Netflix to see what the correct subtitle would look like.

Download Netflix Subtitle Pack [updated 12/23/2017]. (left click, then click the download button in the top right)

This package contains subtitles for 26 different series and movies. Just click the link to see which shows are contained.

If Netflix has another show that you would like Japanese subtitles for, or if you want subtitles in another language, then you will have to rip it for yourself using the guide below.

How to rip Japanese Subtitles from Netflix

Getting the subtitles from Netflix is quite simple now, due to a tool that does all the hard work for us! 

First, you will need to download an addon for your web browser which allows you to run userscripts. One such addon is called ViolentMonkey, and it works with either Firefox or Chrome (as well as some other browsers). There are several other similar addons as well, such as TamperMonkey and GreaseMonkey. These all mostly do the same thing, so just pick one. A simple Google search for any of those titles should easily lead you to a page that lets you install it in your web browser.

Next, you want to install the Netflix Subtitle Downloader. After installing it, you will notice some new options appear inside the subtitle selection menu on the Netflix website. Simply select the subtitle language that you want, and then click on one of the download buttons. It’s that simple! You might need to give it a moment after clicking the button while it begins downloading.

Note: On my system, I have run into some issues where the subtitle downloader will sometimes try to download the subtitle for the previous video that I was looking at. If you run into this issue, this can be resolved by hitting the “refresh” button in your browser after loading a video.

For many languages, especially ones with simple character sets like English and Spanish, the subtitles are downloaded as SRT files. However, for languages with more complex character sets like Japanese, Chinese, or Korean, the subtitles are stored as images. So in order to convert these into a text format, you need to perform OCR (optical character recognition).

Create an API Key for Google Cloud Vision API

There are several OCR tools out there that can handle Japanese text. Most of them suck and result in a lot of errors. Google’s OCR is by far the most accurate I have seen, and works quite well. Unfortunately, it’s only sort of free. According to their current pricing structure, you can OCR up to 1,000 images per month for free. Since a typical episode is a few hundred images, this is enough for a few episodes each month. However, Google also offers a great trial offer (at least at the time I write this). You can get $300 of free credit when you sign up, and you have no obligation pay anything or continue using the service. I opted for this option, and was able to OCR all of the episodes that you find in the download above for free.

If you sign up for the Google Cloud Platform, then after logging in, you need to enable the Cloud Vision API and generate an API key.

  1. In the left hand menu, select APIs & Services > Dashboard
  2. Select Enable APIs & Services
  3. In the search box, type “vision”, and then select Google Cloud Vision API.
  4. Select Enable. It may walk you through setting up a billing profile at this point if one has not been created already. Again, there is no obligation to actually pay anything, as you can use this API a certain amount for free each month, and you may get free credits when signing up.
  5. Back at the APIs & Services Dashboard, select Credentials > Create Credentials > API Key.
  6. Once you have generated the API key, be sure to copy it or keep it open in your browser so you can access it later.

Use generate_srt_from_netflix tool to OCR the images

Now, we can use a tool to send the subtitle images through the Cloud Vision API. Someone by the name of “zx573” from the Kanji Koohii forums originally wrote a python script to perform the work of sending the images to Google and generating a text-based subtitle file. I have updated his tool to make it more user friendly and to fix a few issues it had.

Download

Updated 1/22/18, adding vietnamese language and Mac OSX version.

(left click, then click the download button in the top right)
Windows: generate_srt_from_netflix.Win.x86.zip
Linux: generate_srt_from_netflix.Linux.tar.gz (tested on Ubuntu x64)
Mac: generate_srt_from_netflix.OSX.zip (untested)
Source: python3 source code

Next, you need to paste your API Key into a text file named API_KEY.txt located in the same folder as the application.

When you run the application, it should look like this:

First, you need to make sure that your API Key is displayed correctly in the top area. If not, make sure you did the previous step correctly.

Then, you just select a folder containing netflix subtitle images (note: when you first downloaded the subtitles, they were in a zip file. This zip file must be extracted to a folder before loading here).

There is also an option to select the language that you want Google to recognize. I included Japanese, Korean, and Chinese in the selection box, but you can type in a different language code if you require another language. You can find a full list of language codes here.

The only other option is the chunk size. The default of 15 is usually fine. If you press the start button, and the program appears to begin working but then gives you an error message part way through, you might need to decrease the chunk size to a smaller value like 10 or even 5. Larger values should use up less of your credit but smaller values have a greater chance of completing sucessfully.

After you press start, if all goes well, the program should run and it will output an SRT file inside your input folder.

 

79 thoughts to “Extracting Subtitles from Netflix”

    1. Newer root methods are invisible, so wont be detected by that. So not really a problem. (my phone is rooted with an older method though, so I really ought to get around to updating this myself)

  1. i don’t understand anything. im just here for the subtitles and i just want you to know that terrace house subs seems to be wrong? tried syncing it but most parts just doesnt fit in the video

    1. I’m not sure what video you are trying to sync it to, but if you are trying to use it together with some video file you have downloaded, it will be unlikely to sync up properly. These subtitles and sync were created by Netflix. I have merely published them for people to be able to use as a readable script, and no attempt has been made to see if they sync to any videos that may have been published elsewhere.

      1. actually it’s not just the synchronization because i can easily fix that. but the problem for me is that the subtitles itself says different words. i know because i understand few japanese words and they do not match

  2. Thanks for sharing. I successfully use Subtitle Edit to convert manifest_ttml2.xml and PNG to Blu-ray sup files. But I have too many subtitles, do you know how to batch convert them to Blu-ray sup files? Thanks very much.

    1. When you open the xml file in subtitle edit, it shows the import window which will list all of the subtitle lines. From here, you can right click on any line and choose export>”bluray Sup”. Then a new menu appears where you can choose to “export all lines”. I think this might be what you are looking for.

      1. Thanks for your response. That is the most convenient way, but it will be heavy workload when I have many episodes to do. Is there any other better way? Thanks. (T_T)

    2. You can do it using Subtitle Edit too! Tools -> Batch convert. Add input files, select output folder, format and hit “convert”. Keep in mind that output filename is the same as input. So change names from `manifest_ttml2.xml` to something else so they don’t overwrite each other. 😉

  3. Great information and thoroughly instructions, I am finally able to get the subtitles I want and your method never failed.

    Thank you very much!

    But I still have one question, is there a way to get that “image subtitles” when the films ain’t allowed to be downloaded?

    1. Unfortunately, I have not found any way to get the subtitles for shows that aren’t available for download. It is possible to get text subtitles from any video for simple languages like English or Spanish though.

    1. Thanks for your feedback! I remember finding this thread back when I was originally trying to figure this out, but at the time, it seemed that the method mentioned for arabic subtitles didn’t seem to be working for Japanese. Once I get some time I will review what you have posted and see if I can’t get this working for Japanese as well. That certainly looks like it would be easier than my method.

    2. Looks like I got it working, thank you! The method is slightly different for Japanese than for arabic, but very similar. I’ll make a new post here soon to share this method with others!

  4. And what about text-based subtitles such as English, Spanish, or French? These will also show up in the network monitor, but there doesn’t seem to be any obvious thing to filter out. You will just have to look at all of the items that come over when you load the subtitles and try to locate the correct one.

    Try this /?o= on your monitor filters, subtitles usually start with this.

    1. Downloaded them with my Userscript. Google “netflix subtitle downloader” and there should be a link from Greasyfork. I just updated it to support image based subs after reading this post. 😉

      1. Awesome! Just checked this out and it works great! I’ll need to completely rewrite my guide again now :p

        By the way, I’m not sure if you can add any sort of feedback after clicking on the download link, but I was a bit confused if it was working or not, because it took about a minute for the download to pop up. It would be cool if it just let me know it was doing something.

      2. Ping! Wonder if you could take a look at the comments below in this thread about the kodi plugin that allows downloading subtitles. Apparently all of these image based subtitles have text versions on netflix as well! Would be amazing if you could figure out how to incorporate this into your userscript.

        1. I’ve been trying to make it work whole day. I got all I need to decrypt messages sent from and to server. Decryption throws error. So I’ve tried another method and got that data. It’s compressed with LZW. Decompression throws error. Minified JavaScript code from Netflix gave me headache so I give up for now. Don’t expect it to be incorporated into my script soon or even at all.

          BTW not all image based subs have text versions according to this issue: https://github.com/asciidisco/plugin.video.netflix/issues/95

    1. I just happened to OCR them today myself and posted them up just right before you. If you are manually correcting the errors, that is still very useful though. You might want to just download mine and then correct from there.

  5. Thank you for posting this! I just downloaded the images and would spend some time to learn the OCR process. For now, though, I just wonder where is the time information stored? How does the tool generate srt file with the corresponding timestamp?

      1. Can you explain a bit more about how to install pillow/requests/run python code? Dummy here 🙂

        I managed to install the pillow from .exe file, but not the requests. Which file should I get, .whl or .gz? Do I need to move the downloaded file to under the python folder?

        When I typed “pip install requests” in python command line it gives the SyntaxError: invalid syntax, Same when I try to run the python script.

        Btw, this:
        python generate_srt_from_netflix.py “Terrace House – Boys & Girls in the City 01”
        should look like something like this:
        python generate_srt_from_netflix.py “C:\Users\Lindsay\Desktop\SUBS”
        right?

        Thanks in advance

        1. Hi, please don’t mind the questions above. I have got them figured out. Though now after running I got “responses” error..

          1. Okay. I tried it on korean subs. Instead of actual sub on the output files it writes [TEST HERE]. What went wrong?

          2. Btw, I do not know much about programming and was barely able to follow the guide, so could you put in simple terms?

          3. Lindsay: This problem is because the script is hardcoded to specifically request Japanese OCR. For korean, what you will need to do is open up the .py file in a text editor, and search for the following line (should be line 77): “imageContext”: { “languageHints”: [ “ja”, “en” ] }, # CHANGE FOR MORE LANGUAGES
            Just change the “ja” to “ko”

            Jordynx: I tried to explain it about as simply as I could. Unfortunately this involves command line tools so you will need a certain level of experience to use them. In the future perhaps some better tools can be created that will make the process easier. I’ll be glad to try to help you through any specific problems, though I am not familiar with a “responses” error. Is that the ENTIRE error message? I would need to see exactly what you have done to get this error.

          4. Dear Alan,

            Thank you!! I’ll try that.

            Dear Jordynx,

            For the response error I found that it was I didn’t properly enable google’s vision API.
            Google cloud – api and services – dashboard – enable api and services,
            DO NOT stop there, scroll down to find google vision API, click on, and enable.
            This works for me. If it still doesn’t work, maybe check you credentials.

  6. Hey there. I want to grab greek subtitles but when I put “el” and press next it displays an error message that i should choose only the languages from the drop down menu. Any suggestions on how to proceed?

    1. I didnt thoroughly test different languages, so I can try to take a look at that again when I get some time after the holidays. Are you sure that greek subtitles require OCR though (you downloaded a folder full of images using the subtitle downloading script)? I would have expected greek subs to simply be text.

      1. Me too. I was expecting for text but instead it downloaded a zip file with png files in it. In the language drop down menu if i put zh (chinese) it works (it’s a language you don’t have in this menu). Anyway, if you could check it out when you could i would be thankful. Merry Christmas and I will be waiting for your solution to that. Thanks in advance.

      2. usage: generate_srt_from_netflix.exe [-h] [-c CHUNK] [-l {ja,ko,zh,en}]
        InputFolder
        generate_srt_from_netflix.exe: error: argument -l/–language: invalid choice: ‘el’ (choose from ‘ja’, ‘ko’, ‘zh’, ‘en’)

        That is the error!

        1. Download it again. I have added a few more languages to the drop down box, so it should work for Greek now. I think I have support for all Netflix subtitle languages that could possibly be images now.

  7. Hi, I just wanna say thank you. I don’t know anything about coding, just follow your instruction step by step and it worked! And will the API key go expire or something after using it like couple of times? Seems it’s a crucial element during the whole process.

  8. Oh god thank you so much supporting us in this important topic. By the way, I can’t use ‘vi’ code for my Vietnamese language. I entered ‘vi’ as an option but errors kept coming because it’s not in your language list 🙁

    Can you please add ‘vi’ as an option for Vietnamese language? I really appreciate that.

  9. Hey Alan there is a way to extract srt sub directly from netflix now
    It requires kodi 18
    x64 http://mirrors.kodi.tv/nightlies/windows/win64/master/
    x32 http://mirrors.kodi.tv/nightlies/windows/win32/master/

    first you should create txt file named that” AhmedBafkir.txt” and transfer it to C
    then install kodi 18 and run it
    then go to Adds-on then My Adds-on then VideoPlayer InpuStream then InputStream Adaptive and press enable
    now install this script http://mirrors.kodi.tv/addons/gotham/script.module.requests/script.module.requests-2.12.4.zip
    then install netflix add https://goo.gl/dKerSA
    now open netflix add and sign in and choose any thing and play it
    it will give you error message but all sub links is generated in AhmedBafki txt
    open it with notepad and download
    here is a video but it is in arabic
    https://youtu.be/LH8q1a7NVtM

    1. This looks like a big breakthrough! I tested it out and got text subtitles! Being able to skip the OCR step is what everyone has been waiting on. I wonder if Tithen-Firion’s userscript could be updated to support this? Does this have source code available?

    1. Probably. I modified it to work with DVD subtitles at one time, but I haven’t really tried messing around with BluRay subs as I don’t have any. I can try to look into it if I get some time though.

Leave a Reply

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