From de70d851d8a36ca12350f19c3cc4b00936eaa0ef Mon Sep 17 00:00:00 2001 From: stranothus Date: Mon, 13 Dec 2021 15:40:44 -0600 Subject: [PATCH] Desktop version compatible The desktop version is sent a different resopnse by the Innertube API and streamingData needs to be accessed from data, rather than the third index of data and through playerResponse. --- lib/Constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Constants.js b/lib/Constants.js index a402bcd1..126cdfe0 100644 --- a/lib/Constants.js +++ b/lib/Constants.js @@ -141,7 +141,7 @@ module.exports = { metadata.publish_date = data.microformat.playerMicroformatRenderer.publishDate || 'N/A'; metadata.upload_date = data.microformat.playerMicroformatRenderer.uploadDate || 'N/A'; metadata.keywords = data.videoDetails.keywords || []; - metadata.available_qualities = [...new Set(data[2].playerResponse.streamingData.adaptiveFormats.filter(v => v.qualityLabel).map(v => v.qualityLabel).sort((a, b) => +a.replace(/\D/gi, "") - +b.replace(/\D/gi, "")))] + metadata.available_qualities = [...new Set(data.streamingData.adaptiveFormats.filter(v => v.qualityLabel).map(v => v.qualityLabel).sort((a, b) => +a.replace(/\D/gi, "") - +b.replace(/\D/gi, "")))] video_details.id = data.videoDetails.videoId; video_details.title = data.videoDetails.title;