From c037fccac8ae301fa511101dc11ad206bc52c603 Mon Sep 17 00:00:00 2001 From: STRATOS99K <72719473+STRATOS99K@users.noreply.github.com> Date: Sun, 2 May 2021 15:25:09 -0500 Subject: [PATCH] VTT to ASS Fix new streams it was added align:middle line:10% for the new streams, it will get converted to MainTop tested with vivy ep 3(Old stream align:middle line:7%),E5,E6 < & & were not converted before eg, horimiya E9 08:55 --- modules/module.vttconvert.js | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/modules/module.vttconvert.js b/modules/module.vttconvert.js index 5fa1b04..ae6c437 100644 --- a/modules/module.vttconvert.js +++ b/modules/module.vttconvert.js @@ -70,31 +70,14 @@ function convertToAssLine(l, style) { let end = convertTime(l.time_end); let text = convertToAssText(l.text); - // debugger - if (l.ext_param.align != 'middle') { - console.log('[WARN] Detected specific align param, please contact developer'); - cosnole.log(l); - } - if (l.ext_param.vertical) { - console.log('[WARN] Detected specific vertical param, please contact developer'); - cosnole.log(l); - } - if (l.ext_param.line && l.ext_param.line != '7%') { - console.log('[WARN] Detected specific line param, please contact developer'); - cosnole.log(l); - } - if (l.ext_param.position) { - console.log('[WARN] Detected specific position param, please contact developer'); - cosnole.log(l); - } - if (l.text.match(/]*>([^<]*)<\/b>/g, '{\\b1}$1{\\b0}') .replace(/]*>([^<]*)<\/i>/g, '{\\i1}$1{\\i0}') .replace(/]*>([^<]*)<\/u>/g, '{\\u1}$1{\\u0}') - // .replace(/]*>[^<]*<\/c>/g, '') - // .replace(/]*>[^<]*<\/ruby>/g, '') + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/&/g, '&') .replace(/<[^>]>/g, '') .replace(/\\N$/, '') .replace(/ +$/, '');