[skip ci] Implemented compactRadioRenderer node

This commit is contained in:
Brahim Hadriche committed 2025-11-07 17:19:16 -05:00
1 parent 3eb3c0854a
commit 4d1673ecfb
2 files changed
+34 -2

No files matched your search

+3 -1
View File
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
- Nothing worth mentioning yet.
### Added
- Implemented compactRadioRenderer node
## [0.43.9] - 2025-11-07
@@ -105,7 +105,7 @@ namespace Innertube
' "navigateAction": ParseNotImplemented
' TODO:P2 radioRenderer seems like a Mix https://github.com/iBicha/playlet/issues/709
"radioRenderer": ParseRadioRenderer
' "compactRadioRenderer": ParseNotImplemented
"compactRadioRenderer": ParseCompactRadioRenderer
' TODO:P2 A carousel of videos, found on the home tab of a channel.
' Should probably be parsed.
' "carouselItemRenderer": ParseNotImplemented
@@ -1025,6 +1025,36 @@ namespace Innertube
return invalid
end function
function ParseCompactRadioRenderer(nodeData as object, context as object) as object
playlistId = nodeData["playlistId"]
if not IsString(playlistId)
Warning("Invalid playlist ID in compactRadioRenderer", nodeData, context)
return invalid
end if
videoCountText = ParseText(nodeData["videoCountText"])
if videoCountText = ""
videoCountText = ParseText(nodeData["videoCountShortText"])
end if
playlist = {
"type": "playlist"
"playlistId": playlistId
"title": ParseText(nodeData["title"])
"playlistThumbnail": ObjectUtils.Dig(nodeData, ["thumbnail", "thumbnails", 0, "url"])
"videoCountText": videoCountText
}
' Mixes have a videoId, which is the first video in the mix
videoId = ObjectUtils.Dig(nodeData, ["navigationEndpoint", "watchEndpoint", "videoId"])
if IsString(videoId)
playlist["videoId"] = videoId
end if
PushFeedItem(playlist, context)
return invalid
end function
function ParseGridShelfViewModel(nodeData as object, _context as object) as object
return nodeData["contents"]
end function