mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-01-11 20:10:20 +00:00
Merge pull request #58 from STRATOS99K/patch-1
VTT to ASS Fix new streams
This commit is contained in:
commit
f3f432a092
1 changed files with 8 additions and 24 deletions
|
|
@ -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(/<font/)){
|
||||
console.log('[WARN] Detected specific color param, please contact developer');
|
||||
cosnole.log(l);
|
||||
}
|
||||
|
||||
// debugger
|
||||
if (l.ext_param.line === '7%') {
|
||||
style = 'MainTop';
|
||||
}
|
||||
|
||||
if (l.ext_param.line === '10%') {
|
||||
style = 'MainTop';
|
||||
}
|
||||
|
||||
return `Dialogue: 0,${start},${end},${style},,0,0,0,,${text}`;
|
||||
}
|
||||
|
|
@ -109,8 +92,9 @@ function convertToAssText(text) {
|
|||
.replace(/<b[^>]*>([^<]*)<\/b>/g, '{\\b1}$1{\\b0}')
|
||||
.replace(/<i[^>]*>([^<]*)<\/i>/g, '{\\i1}$1{\\i0}')
|
||||
.replace(/<u[^>]*>([^<]*)<\/u>/g, '{\\u1}$1{\\u0}')
|
||||
// .replace(/<c[^>]*>[^<]*<\/c>/g, '')
|
||||
// .replace(/<ruby[^>]*>[^<]*<\/ruby>/g, '')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/&/g, '&')
|
||||
.replace(/<[^>]>/g, '')
|
||||
.replace(/\\N$/, '')
|
||||
.replace(/ +$/, '');
|
||||
|
|
|
|||
Loading…
Reference in a new issue