diff --git a/lib/parser/contents/classes/SectionList.js b/lib/parser/contents/classes/SectionList.js index 3020860d..682d4b3f 100644 --- a/lib/parser/contents/classes/SectionList.js +++ b/lib/parser/contents/classes/SectionList.js @@ -8,9 +8,14 @@ class SectionList { constructor(data) { this.target_id = data.targetId || null; this.contents = Parser.parse(data.contents); - - data.continuations && - (this.continuation = data.continuations[0].nextContinuationData.continuation); + + if (data.continuations) { + if (data.continuations[0].nextContinuationData) { + this.continuation = data.continuations[0].nextContinuationData.continuation; + } else if (data.continuations[0].reloadContinuationData) { + this.continuation = data.continuations[0].reloadContinuationData.continuation; + } + } this.header = Parser.parse(data.header); } diff --git a/lib/parser/youtube/Library.js b/lib/parser/youtube/Library.js index 71478e0b..3f68c03b 100644 --- a/lib/parser/youtube/Library.js +++ b/lib/parser/youtube/Library.js @@ -19,8 +19,8 @@ class Library { const tab = this.#page.contents.tabs.get({ selected: true }); const shelves = tab.content.contents.map((section) => section.contents[0]); - const stats = this.#page.contents.secondary_contents.items.get({ type: 'profileColumnStatsRenderer' }).items; - const user_info = this.#page.contents.secondary_contents.items.get({ type: 'profileColumnUserInfoRenderer' }); + const stats = this.#page.contents.secondary_contents.items.get({ type: 'ProfileColumnStats' }).items; + const user_info = this.#page.contents.secondary_contents.items.get({ type: 'ProfileColumnUserInfo' }); this.profile = { stats, user_info }; diff --git a/lib/parser/ytmusic/Search.js b/lib/parser/ytmusic/Search.js index b3105d24..0bed1911 100644 --- a/lib/parser/ytmusic/Search.js +++ b/lib/parser/ytmusic/Search.js @@ -28,24 +28,24 @@ class Search { const tab = this.#page.contents.tabs.get({ selected: true }); const shelves = tab.content.contents; - const item_section = shelves.get({ type: 'itemSectionRenderer' }); + const item_section = shelves.get({ type: 'ItemSection' }); this.#header = tab.content.header; /** * @type {import('../contents/classes/DidYouMean')} */ - this.did_you_mean = item_section?.contents.get({ type: 'didYouMeanRenderer' }) || null; + this.did_you_mean = item_section?.contents.get({ type: 'DidYouMean' }) || null; /** * @type {import('../contents/classes/ShowingResultsFor')} */ - this.showing_results_for = item_section?.contents.get({ type: 'showingResultsForRenderer' }) || null; + this.showing_results_for = item_section?.contents.get({ type: 'ShowingResultsFor' }) || null; (!!this.did_you_mean || !!this.showing_results_for) && shelves.shift(); if (args.is_continuation || args.is_filtered) { - const shelf = shelves.get({ type: 'musicShelfRenderer' }); + const shelf = shelves.get({ type: 'MusicShelf' }); this.results = shelf.contents; this.#shelf_title = shelf.title.toString();