[+] Youtube auto generate thumbnail

This commit is contained in:
Hykilpikonna
2019-12-25 17:24:58 -05:00
parent 0dcc8c3162
commit 1fcd4c23ea
+5 -5
View File
@@ -36,12 +36,12 @@ class Artwork
// Check image loadability // Check image loadability
let thumb = this.getURL(json.thumbnail); let thumb = this.getURL(json.thumbnail);
if (thumb == null) Error('Error: File not found. ' + json.thumbnail); let url = this.getURL(json.file);
let url;
if (!json.video) // Youtube video thumbnail
if (json.video && thumb == null && json.file.toLowerCase().includes('youtube'))
{ {
url = this.getURL(json.file); thumb = `https://img.youtube.com/vi/${getYoutubeVID(json.file)}/sddefault.jpg`;
if (url == null) Error('Error: File not found.' + json.file);
} }
// Assign // Assign