Parse authorId from authenticated feeds (#648)

This commit is contained in:
Brahim Hadriche authored and GitHub committed 2025-06-09 19:38:51 -04:00
1 parent fc2ffd8c23
commit 68aeec3d6f
3 files changed
+45 -7

No files matched your search

@@ -1064,6 +1064,11 @@ namespace Innertube
"percentDurationWatched": percentDurationWatched
}
authorId = ParseTileRendererAuthorId(nodeData, context)
if authorId <> invalid
video["authorId"] = authorId
end if
PushFeedItem(video, context)
return invalid
end function
@@ -1107,6 +1112,11 @@ namespace Innertube
"videoThumbnails": videoThumbnails
}
authorId = ParseTileRendererAuthorId(nodeData, context)
if authorId <> invalid
video["authorId"] = authorId
end if
PushFeedItem(video, context)
return invalid
end function
@@ -1149,10 +1159,37 @@ namespace Innertube
"lines": renderedLines
}
authorId = ParseTileRendererAuthorId(nodeData, context)
if authorId <> invalid
playlist["authorId"] = authorId
end if
PushFeedItem(playlist, context)
return invalid
end function
function ParseTileRendererAuthorId(nodeData as object, context as object) as dynamic
' We're checking in the long press menu if there's a browseId that starts with "UC".
' This is usually the the id of the channel.
menuItems = ObjectUtils.Dig(nodeData, ["onLongPressCommand", "showMenuCommand", "menu", "menuRenderer", "items"])
if not IsArray(menuItems)
return invalid
end if
for each item in menuItems
if not IsAssociativeArray(item) or not item.DoesExist("menuNavigationItemRenderer")
continue for
end if
menuNavigationItemRenderer = item["menuNavigationItemRenderer"]
browseId = ObjectUtils.Dig(menuNavigationItemRenderer, ["navigationEndpoint", "browseEndpoint", "browseId"])
if not IsString(browseId) or not browseId.StartsWith("UC")
continue for
end if
return browseId
end for
return invalid
end function
function ParseGridRenderer(nodeData as object, context as object) as object
continuation = ObjectUtils.Dig(nodeData, ["continuations", 0, "nextContinuationData", "continuation"])
if IsString(continuation)