Fix cytube rejecting JSON for not correctly formatted videoHeight
This commit is contained in:
parent
4ccec057af
commit
836bba97cb
1 changed files with 11 additions and 1 deletions
12
generator.ts
12
generator.ts
|
@ -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;
|
||||
|
|
Reference in a new issue