Fix cytube rejecting JSON for not correctly formatted videoHeight #1

Merged
sam merged 1 commit from grumbulon/cytube-json-generator:master into master 2022-05-15 16:55:54 +00:00

View file

@ -64,7 +64,17 @@ async function main(): Promise<void> {
Deno.exit(1);
});
const videoLength = stats.duration;
const videoHeight = stats.height; // Cytube wants this to be specific numbers, nmp
let videoHeight = stats.height as number; // Cytube wants this to be specific numbers, nmp
//cytube freaks out if the height isn't a specific expected number so do some cleanup below
if (videoHeight <= 480) {
videoHeight = 480;
}
if (videoHeight <= 720 && videoHeight > 480) {
videoHeight = 720;
}
if (videoHeight <= 1080 && videoHeight > 720) {
videoHeight = 1080;
}
// Convert subtitles to webvtt
const subtitlesFile: string = args._[1] as string;