From 1fcd4c23eaefdb3361bd0aff727001ec4d0b3664 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Wed, 25 Dec 2019 17:24:58 -0500 Subject: [PATCH] [+] Youtube auto generate thumbnail --- src/App.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/App.ts b/src/App.ts index a9d9d90..d12987b 100644 --- a/src/App.ts +++ b/src/App.ts @@ -36,12 +36,12 @@ class Artwork // Check image loadability let thumb = this.getURL(json.thumbnail); - if (thumb == null) Error('Error: File not found. ' + json.thumbnail); - let url; - if (!json.video) + let url = this.getURL(json.file); + + // Youtube video thumbnail + if (json.video && thumb == null && json.file.toLowerCase().includes('youtube')) { - url = this.getURL(json.file); - if (url == null) Error('Error: File not found.' + json.file); + thumb = `https://img.youtube.com/vi/${getYoutubeVID(json.file)}/sddefault.jpg`; } // Assign