diff --git a/playlet-lib/src/components/ChannelView/ChannelView.bs b/playlet-lib/src/components/ChannelView/ChannelView.bs
index 72d8612c..39e45da4 100644
--- a/playlet-lib/src/components/ChannelView/ChannelView.bs
+++ b/playlet-lib/src/components/ChannelView/ChannelView.bs
@@ -66,7 +66,13 @@ function OnContentSet() as void
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.authorLabel.text = content._author
- m.subCountLabel.text = content.subCountText
+
+ subCountText = content.authorSubTitle
+ if StringUtils.IsNullOrEmpty(subCountText)
+ subCountText = content.subCountText
+ end if
+ m.subCountLabel.text = subCountText
+
m.banner.uri = content.banner
if StringUtils.IsNullOrEmpty(content.thumbnail)
m.thumbnail.uri = ""
diff --git a/playlet-lib/src/components/ContentNode/ChannelContentNode.xml b/playlet-lib/src/components/ContentNode/ChannelContentNode.xml
index ac6ffc8a..ec1e7474 100644
--- a/playlet-lib/src/components/ContentNode/ChannelContentNode.xml
+++ b/playlet-lib/src/components/ContentNode/ChannelContentNode.xml
@@ -10,6 +10,7 @@
+
diff --git a/playlet-lib/src/components/Services/Innertube/NodesParser.bs b/playlet-lib/src/components/Services/Innertube/NodesParser.bs
index d5133a55..b9db9d65 100644
--- a/playlet-lib/src/components/Services/Innertube/NodesParser.bs
+++ b/playlet-lib/src/components/Services/Innertube/NodesParser.bs
@@ -146,6 +146,12 @@ namespace Innertube
exit for
end if
end for
+ if StringUtils.IsNullOrEmpty(author) and StringUtils.IsNullOrEmpty(authorId)
+ if IsString(context.currentAuthor) and IsString(context.currentAuthorId)
+ author = context.currentAuthor
+ authorId = context.currentAuthorId
+ end if
+ end if
viewCountText = ParseText(nodeData["shortViewCountText"])
if viewCountText = ""
@@ -180,6 +186,8 @@ namespace Innertube
video = {
"type": "video"
"videoId": videoId
+ "author": author
+ "authorId": authorId
"title": ParseText(nodeData["title"])
"videoThumbnails": videoThumbnails
"viewCountText": viewCountText
@@ -206,6 +214,24 @@ namespace Innertube
return invalid
end if
+ author = invalid
+ authorId = invalid
+ authorPossibleNodes = ["ownerText", "shortBylineText", "longBylineText"]
+ for each authorPossibleNode in authorPossibleNodes
+ node = nodeData[authorPossibleNode]
+ author = ParseText(node)
+ authorId = ObjectUtils.Dig(node, ["runs", 0, "navigationEndpoint", "browseEndpoint", "browseId"])
+ if author <> "" and authorId <> invalid
+ exit for
+ end if
+ end for
+ if StringUtils.IsNullOrEmpty(author) and StringUtils.IsNullOrEmpty(authorId)
+ if IsString(context.currentAuthor) and IsString(context.currentAuthorId)
+ author = context.currentAuthor
+ authorId = context.currentAuthorId
+ end if
+ end if
+
viewCountText = ParseText(nodeData["shortViewCountText"])
if viewCountText = ""
viewCountText = ParseText(nodeData["viewCountText"])
@@ -213,6 +239,19 @@ namespace Innertube
publishedText = ParseText(nodeData["publishedTimeText"])
+ lengthText = ParseText(nodeData["lengthText"])
+ if lengthText = ""
+ thumbnailOverlays = nodeData["thumbnailOverlays"]
+ if IsArray(thumbnailOverlays)
+ for each overlay in thumbnailOverlays
+ lengthText = ParseText(ObjectUtils.Dig(overlay, ["thumbnailOverlayTimeStatusRenderer", "text"]))
+ if lengthText <> ""
+ exit for
+ end if
+ end for
+ end if
+ end if
+
if context.generateVideoThumbnails = true
videoThumbnails = GenerateVideoThumbnails(videoId)
else
@@ -225,10 +264,13 @@ namespace Innertube
video = {
"type": "video"
"videoId": videoId
+ "author": author
+ "authorId": authorId
"title": ParseText(nodeData["title"])
"videoThumbnails": videoThumbnails
"publishedText": publishedText
"viewCountText": viewCountText
+ "lengthText": lengthText
}
PushFeedItem(video, context)
@@ -242,11 +284,22 @@ namespace Innertube
return invalid
end if
+ author = invalid
+ authorId = invalid
+ if IsString(context.currentAuthor) and IsString(context.currentAuthorId)
+ author = context.currentAuthor
+ authorId = context.currentAuthorId
+ end if
+
video = {
"type": "video"
"videoId": videoId
+ "author": author
+ "authorId": authorId
"title": ParseText(nodeData["title"])
"videoThumbnails": GenerateVideoThumbnails(videoId)
+ "viewCountText": ParseText(nodeData["viewCountText"])
+ "publishedText": ParseText(nodeData["publishedTimeText"])
}
PushFeedItem(video, context)
@@ -298,6 +351,8 @@ namespace Innertube
"authorId": channelId
"author": ParseText(nodeData["title"])
"authorThumbnails": ObjectUtils.Dig(nodeData, ["thumbnail", "thumbnails"])
+ "subCountText": ParseText(nodeData["subscriberCountText"])
+ "videoCountText": ParseText(nodeData["videoCountText"])
}
PushFeedItem(channel, context)
@@ -316,6 +371,8 @@ namespace Innertube
"authorId": channelId
"author": ParseText(nodeData["title"])
"authorThumbnails": ObjectUtils.Dig(nodeData, ["thumbnail", "thumbnails"])
+ "subCountText": ParseText(nodeData["subscriberCountText"])
+ "videoCountText": ParseText(nodeData["videoCountText"])
}
PushFeedItem(channel, context)
@@ -348,10 +405,19 @@ namespace Innertube
thumbnail = ObjectUtils.Dig(thumbnailViewModel, ["image", "sources", 0, "url"])
videoCountText = ObjectUtils.Dig(thumbnailViewModel, ["overlays", 0, "thumbnailOverlayBadgeViewModel", "thumbnailBadges", 0, "thumbnailBadgeViewModel", "text"])
+ author = invalid
+ authorId = invalid
+ if IsString(context.currentAuthor) and IsString(context.currentAuthorId)
+ author = context.currentAuthor
+ authorId = context.currentAuthorId
+ end if
+
playlist = {
"type": "playlist"
"playlistId": playlistId
"title": title
+ "author": author
+ "authorId": authorId
"playlistThumbnail": thumbnail
"videoCountText": videoCountText
}
@@ -370,13 +436,25 @@ namespace Innertube
metadata = ObjectUtils.Dig(nodeData, ["metadata", "lockupMetadataViewModel"])
title = ObjectUtils.Dig(metadata, ["title", "content"])
- thumbnail = ObjectUtils.Dig(nodeData, ["contentImage", "collectionThumbnailViewModel", "primaryThumbnail", "thumbnailViewModel", "image", "sources", 0, "url"])
+ thumbnailViewModel = ObjectUtils.Dig(nodeData, ["contentImage", "collectionThumbnailViewModel", "primaryThumbnail", "thumbnailViewModel"])
+ thumbnail = ObjectUtils.Dig(thumbnailViewModel, ["image", "sources", 0, "url"])
+ videoCountText = ObjectUtils.Dig(thumbnailViewModel, ["overlays", 0, "thumbnailOverlayBadgeViewModel", "thumbnailBadges", 0, "thumbnailBadgeViewModel", "text"])
+
+ author = invalid
+ authorId = invalid
+ if IsString(context.currentAuthor) and IsString(context.currentAuthorId)
+ author = context.currentAuthor
+ authorId = context.currentAuthorId
+ end if
playlist = {
"type": "playlist"
"playlistId": playlistId
"title": title
+ "author": author
+ "authorId": authorId
"playlistThumbnail": thumbnail
+ "videoCountText": videoCountText
}
PushFeedItem(playlist, context)
@@ -399,10 +477,20 @@ namespace Innertube
end if
end if
+ author = invalid
+ authorId = invalid
+ if IsString(context.currentAuthor) and IsString(context.currentAuthorId)
+ author = context.currentAuthor
+ authorId = context.currentAuthorId
+ end if
+
video = {
"type": "video"
"videoId": videoId
+ "author": author
+ "authorId": authorId
"title": ObjectUtils.Dig(nodeData, ["overlayMetadata", "primaryText", "content"])
+ "viewCountText": ObjectUtils.Dig(nodeData, ["overlayMetadata", "secondaryText", "content"])
"videoThumbnails": videoThumbnails
}
diff --git a/playlet-lib/src/components/Services/Innertube/Parser.bs b/playlet-lib/src/components/Services/Innertube/Parser.bs
index d318c726..31b0cd2e 100644
--- a/playlet-lib/src/components/Services/Innertube/Parser.bs
+++ b/playlet-lib/src/components/Services/Innertube/Parser.bs
@@ -4,7 +4,7 @@ import "pkg:/source/utils/StringUtils.bs"
namespace Innertube
- function ParseResponse(responseData as object) as object
+ function ParseResponse(responseData as object, context = invalid as object) as object
if responseData = invalid
return []
end if
@@ -14,7 +14,11 @@ namespace Innertube
return []
end if
- context = {
+ if context = invalid
+ context = {}
+ end if
+
+ context.Append({
directives: Innertube.GetParsingDirectives()
feeds: []
@@ -23,7 +27,7 @@ namespace Innertube
items: []
}
generateVideoThumbnails: true
- }
+ })
Innertube.ParseNode(data, context)
@@ -46,7 +50,8 @@ namespace Innertube
}
end if
- title = ObjectUtils.Dig(responseData, ["metadata", "channelMetadataRenderer", "title"])
+ author = ObjectUtils.Dig(responseData, ["metadata", "channelMetadataRenderer", "title"])
+ authorId = ObjectUtils.Dig(responseData, ["metadata", "channelMetadataRenderer", "externalId"])
thumbnails = ObjectUtils.Dig(responseData, ["metadata", "channelMetadataRenderer", "avatar", "thumbnails"])
if thumbnails = invalid
@@ -59,7 +64,6 @@ namespace Innertube
end if
end if
- ucid = ObjectUtils.Dig(responseData, ["metadata", "channelMetadataRenderer", "externalId"])
banners = ObjectUtils.Dig(responseData, ["header", "pageHeaderRenderer", "content", "pageHeaderViewModel", "banner", "imageBannerViewModel", "image", "sources"])
if banners = invalid
banners = []
@@ -123,14 +127,14 @@ namespace Innertube
end if
items = []
- feeds = ParseResponse(responseData)
+ feeds = ParseResponse(responseData, { "currentAuthor": author, "currentAuthorId": authorId })
if feeds.Count() > 0
items = ValidArray(feeds[0].items)
end if
return {
- "author": title
- "authorId": ucid
+ "author": author
+ "authorId": authorId
"authorThumbnails": thumbnails
"authorBanners": banners
"authorSubTitle": authorSubTitle
diff --git a/playlet-lib/src/components/Services/Invidious/InvidiousToContentNode.bs b/playlet-lib/src/components/Services/Invidious/InvidiousToContentNode.bs
index 765be9ab..db6441e9 100644
--- a/playlet-lib/src/components/Services/Invidious/InvidiousToContentNode.bs
+++ b/playlet-lib/src/components/Services/Invidious/InvidiousToContentNode.bs
@@ -116,6 +116,7 @@ namespace InvidiousContent
SetIfExists(node, "channelHandle", item, "channelHandle")
SetIfExists(node, "description", item, "description")
SetIfExists(node, "subCount", item, "subCount")
+ SetIfExists(node, "authorSubTitle", item, "authorSubTitle")
node.subCountText = GetChannelSubCountText(item)
SetIfExists(node, "videoCount", item, "videoCount")
node.videoCountText = GetVideoCountText(item)
diff --git a/playlet-lib/src/components/VideoFeed/VideoRowCell/ChannelRowCell.bs b/playlet-lib/src/components/VideoFeed/VideoRowCell/ChannelRowCell.bs
index 139a2570..e282e1c2 100644
--- a/playlet-lib/src/components/VideoFeed/VideoRowCell/ChannelRowCell.bs
+++ b/playlet-lib/src/components/VideoFeed/VideoRowCell/ChannelRowCell.bs
@@ -1,3 +1,5 @@
+import "pkg:/source/utils/StringUtils.bs"
+
function OnContentSet() as void
content = m.top.itemContent
@@ -7,7 +9,14 @@ function OnContentSet() as void
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.top._author = content._author
- m.top.subCountText = content.subCountText
+ subCountText = content.authorSubTitle
+ if StringUtils.IsNullOrEmpty(subCountText)
+ subCountText = content.videoCountText
+ if StringUtils.IsNullOrEmpty(subCountText)
+ subCountText = content.subCountText
+ end if
+ end if
+ m.top.subCountText = subCountText
m.top.channelHandle = content.channelHandle
m.top.thumbnail = content.thumbnail
end function
diff --git a/playlet-lib/src/components/VideoFeed/VideoRowCell/ChannelRowCell.xml b/playlet-lib/src/components/VideoFeed/VideoRowCell/ChannelRowCell.xml
index 6cd45b9e..ca57a98f 100644
--- a/playlet-lib/src/components/VideoFeed/VideoRowCell/ChannelRowCell.xml
+++ b/playlet-lib/src/components/VideoFeed/VideoRowCell/ChannelRowCell.xml
@@ -20,13 +20,14 @@
+ wrap="true"
+ font="font:SmallestBoldSystemFont" />