File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ export type Nodes = {
8787 | Renderer < 'MusicShelf' >
8888 | Renderer < 'MusicPlaylistShelf' >
8989 | Renderer < 'MusicResponsiveHeader' >
90+ | Renderer < 'MusicCarouselShelf' >
9091 ) [ ] ;
9192 } ;
9293 /** @see https://github.com/LuanRT/YouTube.js/blob/v14.0.0/src/parser/classes/ItemSection.ts */
@@ -138,6 +139,30 @@ export type Nodes = {
138139 MusicCardShelfHeaderBasic : unknown ;
139140 /** @see https://github.com/LuanRT/YouTube.js/blob/v14.0.0/src/parser/classes/MusicItemThumbnailOverlay.ts */
140141 MusicItemThumbnailOverlay : unknown ;
142+ /** @see https://github.com/LuanRT/YouTube.js/blob/v14.0.0/src/parser/classes/MusicCarouselShelf.ts */
143+ MusicCarouselShelf : {
144+ header : Renderer < 'MusicCarouselShelfBasicHeader' > ;
145+ contents : Renderer < 'MusicTwoRowItem' > [ ] ;
146+ } ;
147+ /** @see https://github.com/LuanRT/YouTube.js/blob/v14.0.0/src/parser/classes/MusicCarouselShelfBasicHeader.ts */
148+ MusicCarouselShelfBasicHeader : {
149+ title : YTText ;
150+ accessibilityData ?: {
151+ accessibilityData : {
152+ label ?: string ;
153+ } ;
154+ } ;
155+ } ;
156+ /** @see https://github.com/LuanRT/YouTube.js/blob/v14.0.0/src/parser/classes/MusicTwoRowItem.ts */
157+ MusicTwoRowItem : {
158+ thumbnailRenderer ?: Renderer < 'MusicThumbnail' > ;
159+ aspectRatio ?: string ;
160+ title : YTText ;
161+ subtitle ?: YTText ;
162+ navigationEndpoint : BrowseEndpoint ;
163+ menu ?: Renderer < 'Menu' > ;
164+ thumbnailOverlay : Renderer < 'MusicItemThumbnailOverlay' > ;
165+ } ;
141166 /** @see https://github.com/LuanRT/YouTube.js/blob/v14.0.0/src/parser/classes/MusicResponsiveListItem.ts */
142167 MusicResponsiveListItem : {
143168 thumbnail : Renderer < 'MusicThumbnail' > ;
Original file line number Diff line number Diff line change @@ -438,6 +438,22 @@ export class YouTubeMusicReleaseLookup extends ReleaseLookup<YouTubeMusicProvide
438438 release . releaseDate = { year : releaseYear } ;
439439 }
440440
441+ const otherVersions = album
442+ . contents
443+ ?. twoColumnBrowseResultsRenderer
444+ . secondaryContents . sectionListRenderer
445+ . contents
446+ . filter ( ( renderer ) => 'musicCarouselShelfRenderer' in renderer )
447+ . map ( ( shelf ) => shelf . musicCarouselShelfRenderer )
448+ . find ( ( shelf ) => shelf . header . musicCarouselShelfBasicHeaderRenderer . title . runs . at ( 0 ) ?. text === 'Other versions' )
449+ ?. contents
450+ . map ( ( item ) => item . musicTwoRowItemRenderer . navigationEndpoint . browseEndpoint . browseId )
451+ . map ( ( id ) => this . provider . constructUrl ( { id, type : BROWSE } ) ) ;
452+
453+ if ( otherVersions ) {
454+ this . warnMultipleResults ( otherVersions ) ;
455+ }
456+
441457 return release ;
442458 }
443459
You can’t perform that action at this time.
0 commit comments