feat: extract avatar of the channel which added a video to a
collaborative playlist surprisingly, innertube response contains the user's avatar, but doesn't contain the ucid, name nor the handle
This commit is contained in:
@@ -371,6 +371,11 @@ def parseRenderers(entry: dict, context: dict = {}) -> dict:
|
||||
author_name = ", ".join(all_authors)
|
||||
author_ucid = safeTraverse(livm, [0, "listItemViewModel", "title", "commandRuns", 0, "onTap", "innertubeCommand", "browseEndpoint", "browseId"], default="UNKNOWNCHANNELID")
|
||||
|
||||
# surprisingly, innertube responds with the avatar of the user that added the video to the playlist
|
||||
# we can extract that information, e.g. for yattee to display
|
||||
avatar_url = safeTraverse(entry, ["playlistVideoRenderer", "thumbnailOverlays", ..., "thumbnailOverlayAvatarStackViewModel", "avatarStack", "avatarStackViewModel", "avatars", 0, "avatarViewModel", "image", "sources", 0, "url"])
|
||||
avatars = None if avatar_url is None else ythdd_extractor.generateChannelAvatarsFromUrl(avatar_url)
|
||||
|
||||
return {
|
||||
"type": "video",
|
||||
"title": title,
|
||||
@@ -378,6 +383,7 @@ def parseRenderers(entry: dict, context: dict = {}) -> dict:
|
||||
"author": author_name,
|
||||
"authorId": author_ucid,
|
||||
"authorUrl": "/channel/" + author_ucid,
|
||||
"authorThumbnails": avatars,
|
||||
"videoThumbnails": genThumbs(video_id),
|
||||
"index": video_index,
|
||||
"lengthSeconds": length,
|
||||
|
||||
Reference in New Issue
Block a user