JS to export subtitles from VEED
JS to export subtitles from VEED - Online Video Editor - Video Editing Made Simple
var subtitles = document.getElementsByClassName('TextEditorStyled__Group-sc-nw7y0k-5 dDCwC'); let srcs = ""; for(var i = 0; i < subtitles.length; i ++) { var from = subtitles[i].getElementsByClassName("TimeInput__StyledInput-sc-3qy9xb-0 fYJwAF")[0].value.replace(".", ","); var to = subtitles[i].getElementsByClassName("TimeInput__StyledInput-sc-3qy9xb-0 fYJwAF")[1].value.replace(".", ","); var text = subtitles[i].getElementsByClassName("subtitle-row")[0].getElementsByTagName("textarea")[0].value; //console.log("00:%s00 --> 00:%s00\r\n%s", from, to, text); srcs += `${i+1}\r\n00:${from}00 --> 00:${to}00\r\n${text}\r\n\r\n`; } srcs += "\r\n"; console.log(srcs);
----------
// v2
----------
var subtitles = document.getElementsByClassName('DraftJsSubtitleRowstyled__Row-sc-um8k5a-2 hjxeTD'); let srcs = ""; for(var i = 0; i < subtitles.length; i ++) { var from = subtitles[i].getElementsByClassName("SubtitleTimeInputstyled__StyledInput-sc-16q2lkz-1")[0].value.replace(".", ","); var to = subtitles[i].getElementsByClassName("SubtitleTimeInputstyled__StyledInput-sc-16q2lkz-1")[1].value.replace(".", ","); var text = subtitles[i].getElementsByClassName("public-DraftStyleDefault-block public-DraftStyleDefault-ltr")[0].innerText; //console.log("00:%s00 --> 00:%s00\r\n%s", from, to, text); srcs += `${i+1}\r\n00:${from}00 --> 00:${to}00\r\n${text}\r\n\r\n`; } srcs += "\r\n"; console.log(srcs);