<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d8211560\x26blogName\x3dTech+Tips,+Tricks+%26+Trivia\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://mvark.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://mvark.blogspot.com/\x26vt\x3d601588505461698440', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
An architect's notes, experiments, discoveries and annotated bookmarks.

HOW TO extract subtitles from a YouTube video

Subtitles within videos help non-native speakers clearly understand & follow what's going on while the video is playing. If you wish to take notes from a YouTube video, you will find this tip for extracting the subtitles from a YouTube video (that has subtitles) to be a time-saver. I have adapted this tip from an answer to a related question on the Quora website -
  • Open the video page in Chrome browser (or any other browser that provides HTTP debugging/Developer Tools) and pause the video
  • Right click anywhere on the page, and click on Inspect Element OR hit the F12 function key.
  • Click on Network tab
  • Under the Network tab look for an item called timedtext. 
  • Right click on it and open that file in a new tab.
  • An xml file containing subtitles with their timestamps(the stuff inside of <>) opens up.
To get rid of the timestamps and just have the plain transcript, here is what you have to do:
  • Open up Microsoft Excel
  • Copy paste the subtitles inside one cell
  • Press Ctrl+H
  • In the replace tab type <*> in the Find What textbox and leave the Replace With  textbox  blank, and click Replace All. The search expression will remove all tags within the original text.
[Update:16-July-2012] As per this WebApps StackExchange forum thread, there are two other ways to get the subtitles:

By specifying the language and VideoId in this generic URL - http://video.google.com/timedtext?lang=<LANG>&v=<VIDEOID> http://www.youtube.com/api/timedtext?lang=<LANG>&v=<VIDEOID> you can get an .xml file containing the subtitles in the desired language for a choosen video.

For example, for a English subtitles for a video whose id is CjarTgjKcX8, try https://www.youtube.com/api/timedtext?lang=en&v=CjarTgjKcX8

The subtitles can be fetched only if captions are manually transcribed i.e. not automatically generated.

There is an open-source tool called Google2SRT that downloads all available subs from a YouTube video with one click & converts them into .srt format so that it can be used within media players like VLC Media Player.

Also see:
Low bandwidth? Try mobile version of popular websites on PC/laptop
HOW TO add subtitles to YouTube videos
Summaries of Google Webmaster Central YouTube videos

Labels: , ,

Tweet this | Share via Whatsapp | Share on FB

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »

Posted by Blogger Unknown | 10/28/2012 04:14:00 AM

As per WebApps StackExchange forum thread there's a third way doing this, by using YT subtitles tool    

Posted by Blogger Garry | 5/30/2013 12:09:00 PM

Thanks for the tutorial. Worked great for me.    

Posted by Blogger Unknown | 4/02/2014 06:37:00 AM

Unfortunately, this doesn't seem to work anymore. I tried it on videoid k2JhgP6l0ss    

Posted by Blogger Anil | 4/02/2014 08:43:00 AM

@Sepero - The subtitles can be fetched only if captions are manually transcribed i.e. not if they are automatically generated. The video you mentioned has automated captions.    

Posted by Blogger Gilvacir | 7/13/2014 06:01:00 PM

Thanks Mr. You save me. \o/    

Posted by Blogger Unknown | 9/28/2015 05:18:00 PM

I can recommend ccsubs.com - That's a website to download subtitles & closed captions from youtube videos. Many languages & formats are supported.

It is possible to get the closed captions provided by the video creator, or the automatically translated captions created with speech recognition technology by youtube.    


Post a Comment