Created
September 27, 2012 09:58
-
-
Save eunjae-lee/3793227 to your computer and use it in GitHub Desktop.
Get subtitle from Youtube as SMI format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var smi = []; | |
smi.push("<SAMI><BODY>"); | |
$('#transcript-scrollbox .caption-line').map(function (idx, item) { | |
var time = parseInt(($(item).attr('data-time') - 0)*1000); | |
var text = $('.caption-line-text', $(item)).html() | |
smi.push("<SYNC Start=" + time + "><P Class=ENCC>" + text + "\n"); | |
}); | |
smi.push("</BODY></SAMI>"); | |
console.log(smi.join('\n')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://youtu.be/kImpWphugRY