mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-03-11 17:45:30 +00:00
[CR] Convert CC's from vtt to ass
This commit is contained in:
parent
83d410378a
commit
a5df6bee2f
2 changed files with 5 additions and 5 deletions
1
@types/crunchyTypes.d.ts
vendored
1
@types/crunchyTypes.d.ts
vendored
|
|
@ -35,6 +35,7 @@ export type CrunchyDownloadOptions = {
|
|||
nocleanup: boolean,
|
||||
chapters: boolean,
|
||||
fontName: string | undefined,
|
||||
originalFontSize: boolean,
|
||||
fontSize: number,
|
||||
dubLang: string[],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import { CrunchyAndroidEpisodes } from './@types/crunchyAndroidEpisodes';
|
|||
import { parse } from './modules/module.transform-mpd';
|
||||
import { CrunchyAndroidObject } from './@types/crunchyAndroidObject';
|
||||
import { CrunchyChapters, CrunchyChapter, CrunchyOldChapter } from './@types/crunchyChapters';
|
||||
import vtt2ass from './modules/module.vtt2ass';
|
||||
|
||||
export type sxItem = {
|
||||
language: langsData.LanguageItem,
|
||||
|
|
@ -2024,11 +2025,9 @@ export default class Crunchy implements ServiceClass {
|
|||
if(subsAssReq.ok && subsAssReq.res){
|
||||
let sBody;
|
||||
if (subsItem.format == 'vtt') {
|
||||
//TODO: look into converting downloaded vtt into ASS
|
||||
//sBody = vttConvert(subsAssReq.res.body, false, langItem.language, options.fontSize, options.fontName);
|
||||
sBody = subsAssReq.res.body;
|
||||
//TODO: look into parsing the fonts from the styles field in the VTT
|
||||
sxData.fonts = options.fontName ? [options.fontName] as Font[] : [];
|
||||
const chosenFontSize = options.originalFontSize ? undefined : options.fontSize;
|
||||
sBody = vtt2ass(undefined, options.fontSize, subsAssReq.res.body, '', undefined, options.fontName);
|
||||
sxData.fonts = fontsData.assFonts(sBody) as Font[];
|
||||
} else {
|
||||
sBody = '\ufeff' + subsAssReq.res.body;
|
||||
const sBodySplit = sBody.split('\r\n');
|
||||
|
|
|
|||
Loading…
Reference in a new issue