Ripping YouTube closed captions from a video

Few days ago, I needed to download a complete video from YouTube including it’s subtitles.

There are many tools and browser plug-ins allowing you to download the video itself, just take a look at UserScripts. But I didn’t find any tool, that still works, which allows me to download the closed captions for a video.

I’ve decided to take a look at it myself. I’ve found the following video with closed-captions: and started sniffing around.

Using chrome’s Development Tool, I’ve monitored the traffic to YouTube servers and found out the following requests:

Chrome's Development Tool


As you can see, there are two requests for a file called “timedtext” that caught my eyes immediately. The first request was a listing request, “Waiter, Gimme’ a menu of all the captions please”. YouTube’s player passes a lot of data in each of those request, But most of it is not needed. I’ve managed to reduce the request to the following fields:

Where instead of VIDEO-ID you should write the video ID from the URL path. For example, in Randall Munroe’s lecture, the request will be:

When I’ve opened the link in my browser I got the following XML in response:

<transcript_list docid="-3705456634442126482">
<track id="0" name="" lang_code="en" lang_original="English" lang_translated="English" lang_default="true"/>

The first and the last lines, don’t contain any interesting information. The second line, does. The second line tells us there are english closed caption for this video.

So, How do we get the captions?
That’s when the second request takes place. In the second request we actually ordered the specific captions of our choice, “Waiter, I would like the english captions please”.
Again, I’ve reduced the fields to the following request:

Where the VIDEO-ID is the video identifier again, and the LANGUAGE-CODE is the lang_code attribute’s value from the list XML we requested earlier. For example, for our video and for english captions (The only one this video got) the request will be:

And that’s it. This address contains the entire english captions of our video in a XML format.

This site is hosted by:

2 Responses to “Ripping YouTube closed captions from a video”

  • Spiki Says:

    On this website: you can download subtitles for YouTube videos in the original language or translation of the subtitle that made YouTube into any language.
    You have to copy the link of the video from youtube and paste it into 2srt and then select any available subtitle and if you download it without translation or no translation into any language you want and download it there, if any, should try several of the subtitles there are real then translate because the translation can vary widely making youtube, here’s a videito of how is downloaded in. srt to download the video you can use programs such as good “YouTube Catcher” or “Freemake Video Converter”.

Leave a Reply