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.
This commit is contained in:
stranothus
2021-12-13 15:40:44 -06:00
parent e20e671d16
commit de70d851d8

View File

@@ -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;