From 7d91f32af297ed745e5342ab98eecb17d062720b Mon Sep 17 00:00:00 2001 From: snobu Date: Tue, 11 May 2021 11:06:16 +0300 Subject: [PATCH] Fix for null thumbnail URL --- src/Types.ts | 2 +- src/destreamer.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Types.ts b/src/Types.ts index 4fc5076..b477354 100644 --- a/src/Types.ts +++ b/src/Types.ts @@ -16,7 +16,7 @@ export type Video = { outPath: string; totalChunks: number; // Abstraction of FFmpeg timemark playbackUrl: string; - posterImageUrl: string; + posterImageUrl: string | null; captionsUrl?: string } diff --git a/src/destreamer.ts b/src/destreamer.ts index 9bf64ef..6d3491e 100644 --- a/src/destreamer.ts +++ b/src/destreamer.ts @@ -185,7 +185,9 @@ async function downloadVideo(videoGUIDs: Array, outputDirectories: Array const headers: string = 'Authorization: Bearer ' + session.AccessToken; if (!argv.noExperiments) { - await drawThumbnail(video.posterImageUrl, session); + if (video.posterImageUrl) { + await drawThumbnail(video.posterImageUrl, session); + } } const ffmpegInpt: any = new FFmpegInput(video.playbackUrl, new Map([