mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-03-11 17:45:30 +00:00
added more subtitle fixes for
This commit is contained in:
parent
2687e5247b
commit
b67ba124c7
1 changed files with 13 additions and 7 deletions
20
crunchy.ts
20
crunchy.ts
|
|
@ -2753,9 +2753,6 @@ export default class Crunchy implements ServiceClass {
|
|||
break;
|
||||
}
|
||||
|
||||
// Removing CCC credits
|
||||
sBody = sBody.replace('; Script generated by Closed Caption Converter | www.closedcaptionconverter.com\n', '');
|
||||
|
||||
const lines = sBody.split('\n');
|
||||
|
||||
// Add PlayResX, PlayResY, Timer and WrapStyle
|
||||
|
|
@ -2767,21 +2764,30 @@ export default class Crunchy implements ServiceClass {
|
|||
sBody = lines.join('\n');
|
||||
}
|
||||
|
||||
if (!sBody.includes('www.closedcaptionconverter.com')) {
|
||||
if (!options.noSubFix) {
|
||||
// LayoutRes Fix
|
||||
if (options.layoutResFix && !options.noSubFix) {
|
||||
if (options.layoutResFix && !sBody.includes('LayoutResX') && !sBody.includes('LayoutResY')) {
|
||||
sBody = sBody.replace(/^(PlayResY:\s*\d+)/m, `$1\nLayoutResX: ${playResX}\nLayoutResY: ${playResY}`);
|
||||
}
|
||||
|
||||
// ScaleBorderAndShadow Fix
|
||||
if (options.scaledBorderAndShadowFix && !options.noSubFix) {
|
||||
if (options.scaledBorderAndShadowFix && !sBody.includes('ScaledBorderAndShadow')) {
|
||||
sBody = sBody.replace(/^(WrapStyle:.*)$/m, `$1\nScaledBorderAndShadow: ${options.scaledBorderAndShadow}`);
|
||||
}
|
||||
|
||||
// Fix VLC wrong parsing if URL not avaiable
|
||||
if (options.originalScriptFix && !options.noSubFix) {
|
||||
if (options.originalScriptFix) {
|
||||
sBody = sBody.replace(/^Original Script:.*$/gm, 'Original Script: Crunchyroll');
|
||||
}
|
||||
|
||||
// Remove All Comments
|
||||
sBody = sBody.replace(/^[ \t]*;.*\r?\n?/gm, '');
|
||||
|
||||
// Remove Aegisub Project Garbage
|
||||
sBody = sBody.replace(/\[Aegisub Project Garbage\][\s\S]*?(?:\r?\n(?=\[)|$)/, '');
|
||||
|
||||
// Remove YCbCr
|
||||
sBody = sBody.replace(/^[ \t]*YCbCr Matrix:\s*.*\r?\n?/m, '');
|
||||
}
|
||||
|
||||
sxData.title = langItem.language;
|
||||
|
|
|
|||
Loading…
Reference in a new issue