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