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,
|
nocleanup: boolean,
|
||||||
chapters: boolean,
|
chapters: boolean,
|
||||||
fontName: string | undefined,
|
fontName: string | undefined,
|
||||||
|
originalFontSize: boolean,
|
||||||
fontSize: number,
|
fontSize: number,
|
||||||
dubLang: string[],
|
dubLang: string[],
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ import { CrunchyAndroidEpisodes } from './@types/crunchyAndroidEpisodes';
|
||||||
import { parse } from './modules/module.transform-mpd';
|
import { parse } from './modules/module.transform-mpd';
|
||||||
import { CrunchyAndroidObject } from './@types/crunchyAndroidObject';
|
import { CrunchyAndroidObject } from './@types/crunchyAndroidObject';
|
||||||
import { CrunchyChapters, CrunchyChapter, CrunchyOldChapter } from './@types/crunchyChapters';
|
import { CrunchyChapters, CrunchyChapter, CrunchyOldChapter } from './@types/crunchyChapters';
|
||||||
|
import vtt2ass from './modules/module.vtt2ass';
|
||||||
|
|
||||||
export type sxItem = {
|
export type sxItem = {
|
||||||
language: langsData.LanguageItem,
|
language: langsData.LanguageItem,
|
||||||
|
|
@ -2024,11 +2025,9 @@ export default class Crunchy implements ServiceClass {
|
||||||
if(subsAssReq.ok && subsAssReq.res){
|
if(subsAssReq.ok && subsAssReq.res){
|
||||||
let sBody;
|
let sBody;
|
||||||
if (subsItem.format == 'vtt') {
|
if (subsItem.format == 'vtt') {
|
||||||
//TODO: look into converting downloaded vtt into ASS
|
const chosenFontSize = options.originalFontSize ? undefined : options.fontSize;
|
||||||
//sBody = vttConvert(subsAssReq.res.body, false, langItem.language, options.fontSize, options.fontName);
|
sBody = vtt2ass(undefined, options.fontSize, subsAssReq.res.body, '', undefined, options.fontName);
|
||||||
sBody = subsAssReq.res.body;
|
sxData.fonts = fontsData.assFonts(sBody) as Font[];
|
||||||
//TODO: look into parsing the fonts from the styles field in the VTT
|
|
||||||
sxData.fonts = options.fontName ? [options.fontName] as Font[] : [];
|
|
||||||
} else {
|
} else {
|
||||||
sBody = '\ufeff' + subsAssReq.res.body;
|
sBody = '\ufeff' + subsAssReq.res.body;
|
||||||
const sBodySplit = sBody.split('\r\n');
|
const sBodySplit = sBody.split('\r\n');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue