From c46a7282bbe7d614597a6100e7d6a0040f9d9702 Mon Sep 17 00:00:00 2001 From: Casper Date: Tue, 22 Dec 2020 10:06:54 +0100 Subject: [PATCH] chore: bump ytdl-core and fix warnings (#199) --- package.json | 2 +- src/Player.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 785eef5..524c2c4 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "soundcloud-scraper": "^4.0.0", "spotify-url-info": "^2.2.0", "youtube-sr": "^2.0.1", - "ytdl-core": "^4.0.6" + "ytdl-core": "^4.2.1" }, "devDependencies": { "@discordjs/opus": "^0.3.2", diff --git a/src/Player.js b/src/Player.js index 457c49c..c7cde36 100644 --- a/src/Player.js +++ b/src/Player.js @@ -327,13 +327,14 @@ class Player extends EventEmitter { trackToPlay = query } else if (this.util.isYTVideoLink(query)) { const videoData = await ytdl.getBasicInfo(query) + const lastThumbnail = videoData.videoDetails.thumbnails.length - 1 /* get the highest quality thumbnail */ trackToPlay = new Track({ title: videoData.videoDetails.title, url: videoData.videoDetails.video_url, views: videoData.videoDetails.viewCount, - thumbnail: videoData.videoDetails.thumbnail.thumbnails[0], + thumbnail: videoData.videoDetails.thumbnails[lastThumbnail], lengthSeconds: videoData.videoDetails.lengthSeconds, - description: videoData.videoDetails.shortDescription, + description: videoData.videoDetails.description, author: { name: videoData.videoDetails.author.name }