<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\758211560\46blogName\75Tech+Tips,+Tricks+%26+Trivia\46publishMode\75PUBLISH_MODE_BLOGSPOT\46navbarType\75BLUE\46layoutType\75CLASSIC\46searchRoot\75http://mvark.blogspot.com/search\46blogLocale\75en\46v\0752\46homepageUrl\75http://mvark.blogspot.com/\46vt\75-5147029996388199615', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
A seasoned developer's little discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks


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.

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 | Google+ it | Share on FB

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

Posted by Blogger john pearson | 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 Sepero P | 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.    



»

Post a Comment