mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-03-11 17:45:30 +00:00
Added different fonts for Crunchyroll CCC fix
This commit is contained in:
parent
8546ba4a5d
commit
1f667b110f
1 changed files with 11 additions and 6 deletions
17
crunchy.ts
17
crunchy.ts
|
|
@ -2670,10 +2670,16 @@ export default class Crunchy implements ServiceClass {
|
|||
// Fix invalid Dialogue and remove PlayDepth
|
||||
sBody = sBody.replace(/,,,,25.00,,/g, ',,0,0,0,,').replace('PlayDepth: 0\n', '');
|
||||
|
||||
// Fix fonts (default crunchyroll german sub font)
|
||||
sBody = sBody.replace(/^Style:\s*([^,]+),.*?,(\d+),0,0,0,0$/gm, (match, name, align) => {
|
||||
return `Style: ${name},Arial,23,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,-1,0,0,0,100,100,0,0,1,2,0,${align},0,0,20,1`;
|
||||
});
|
||||
// Fix fonts
|
||||
if (langItem.language === 'German') {
|
||||
sBody = sBody.replace(/^Style:\s*([^,]+),.*?,(\d+),0,0,0,0$/gm, (match, name, align) => {
|
||||
return `Style: ${name},Arial,23,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,-1,0,0,0,100,100,0,0,1,2,0,${align},0,0,20,1`;
|
||||
});
|
||||
} else {
|
||||
sBody = sBody.replace(/^Style:\s*([^,]+),.*?,(\d+),0,0,0,0$/gm, (match, name, align) => {
|
||||
return `Style: ${name},Trebuchet MS,24,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2,1,${align},0010,0010,0018,0`;
|
||||
});
|
||||
}
|
||||
|
||||
// Removing CCC credits
|
||||
sBody = sBody.replace('; Script generated by Closed Caption Converter | www.closedcaptionconverter.com\n', '');
|
||||
|
|
@ -2706,8 +2712,7 @@ export default class Crunchy implements ServiceClass {
|
|||
}
|
||||
}
|
||||
|
||||
sxData.title = sBody.split('\r\n')[1].replace(/^Title: /, '');
|
||||
sxData.title = `${langItem.language} / ${sxData.title}`;
|
||||
sxData.title = langItem.language;
|
||||
sxData.fonts = fontsData.assFonts(sBody) as Font[];
|
||||
}
|
||||
fs.writeFileSync(sxData.path, sBody);
|
||||
|
|
|
|||
Loading…
Reference in a new issue