From 2010714f50c78f92e1b76a29fc83ecb961c2611d Mon Sep 17 00:00:00 2001 From: "luan.lrt4@gmail.com" Date: Sun, 24 Apr 2022 22:52:21 -0300 Subject: [PATCH] fix: uncaught exception when retrieving private playlists --- lib/parser/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/parser/index.js b/lib/parser/index.js index 23bf2c28..463c6098 100644 --- a/lib/parser/index.js +++ b/lib/parser/index.js @@ -133,12 +133,12 @@ class Parser { const metadata = { title: this.data.metadata.playlistMetadataRenderer.title, - description: details.playlistSidebarPrimaryInfoRenderer.description.simpleText || 'N/A', - total_items: details.playlistSidebarPrimaryInfoRenderer.stats[0].runs[0].text, - last_updated: details.playlistSidebarPrimaryInfoRenderer.stats[2].runs[1].text, + description: details.playlistSidebarPrimaryInfoRenderer?.description?.simpleText || 'N/A', + total_items: details.playlistSidebarPrimaryInfoRenderer.stats[0].runs[0]?.text || 'N/A', + last_updated: details.playlistSidebarPrimaryInfoRenderer.stats[2].runs[1]?.text || 'N/A', views: details.playlistSidebarPrimaryInfoRenderer.stats[1].simpleText } - + const list = Utils.findNode(this.data, 'contents', 'contents', 13, false); const items = YTDataItems.PlaylistItem.parse(list.contents); @@ -545,4 +545,4 @@ class Parser { } } -module.exports = Parser; +module.exports = Parser; \ No newline at end of file