Handle TILE_CONTENT_TYPE_SHORTS
This commit is contained in:
1 parent
013e2f49ca
commit
1c6b47a5a6
3 files changed
+45
No files matched your search
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
- Nothing worth mentioning yet.
|
||||||
|
|
||||||
## [0.38.1] - 2025-05-20
|
## [0.38.1] - 2025-05-20
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ namespace Innertube
|
|||||||
"clientFormFactor": "UNKNOWN_FORM_FACTOR"
|
"clientFormFactor": "UNKNOWN_FORM_FACTOR"
|
||||||
"webpSupport": false
|
"webpSupport": false
|
||||||
"tvAppInfo": {
|
"tvAppInfo": {
|
||||||
|
' "appQuality": "TV_APP_QUALITY_FULL_ANIMATION"
|
||||||
"appQuality": "TV_APP_QUALITY_LIMITED_MEMORY"
|
"appQuality": "TV_APP_QUALITY_LIMITED_MEMORY"
|
||||||
"useStartPlaybackPreviewCommand": false
|
"useStartPlaybackPreviewCommand": false
|
||||||
"supportsNativeScrolling": false
|
"supportsNativeScrolling": false
|
||||||
|
|||||||
@@ -938,6 +938,8 @@ namespace Innertube
|
|||||||
|
|
||||||
if contentType = "TILE_CONTENT_TYPE_VIDEO"
|
if contentType = "TILE_CONTENT_TYPE_VIDEO"
|
||||||
return TileRendererTypeVideo(nodeData, context)
|
return TileRendererTypeVideo(nodeData, context)
|
||||||
|
else if contentType = "TILE_CONTENT_TYPE_SHORTS"
|
||||||
|
return TileRendererTypeShorts(nodeData, context)
|
||||||
else if contentType = "TILE_CONTENT_TYPE_PLAYLIST"
|
else if contentType = "TILE_CONTENT_TYPE_PLAYLIST"
|
||||||
return TileRendererTypePlaylist(nodeData, context)
|
return TileRendererTypePlaylist(nodeData, context)
|
||||||
end if
|
end if
|
||||||
@@ -1017,6 +1019,44 @@ namespace Innertube
|
|||||||
return invalid
|
return invalid
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function TileRendererTypeShorts(nodeData as object, context as object) as object
|
||||||
|
videoId = nodeData["contentId"]
|
||||||
|
if not IsString(videoId)
|
||||||
|
LogWarn("Invalid video ID", nodeData)
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
if context.generateVideoThumbnails = true
|
||||||
|
videoThumbnails = GenerateVideoThumbnails(videoId)
|
||||||
|
else
|
||||||
|
videoThumbnails = ObjectUtils.Dig(nodeData, ["header", "tileHeaderRenderer", "thumbnail", "thumbnails"])
|
||||||
|
if videoThumbnails = invalid
|
||||||
|
videoThumbnails = GenerateVideoThumbnails(videoId)
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
|
||||||
|
title = ""
|
||||||
|
thumbnailOverlays = ObjectUtils.Dig(nodeData, ["header", "tileHeaderRenderer", "thumbnailOverlays"])
|
||||||
|
if IsArray(thumbnailOverlays)
|
||||||
|
for each overlay in thumbnailOverlays
|
||||||
|
title = ParseText(ObjectUtils.Dig(overlay, ["tileMetadataRenderer", "title"]))
|
||||||
|
if title <> ""
|
||||||
|
exit for
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
end if
|
||||||
|
|
||||||
|
video = {
|
||||||
|
"type": "video"
|
||||||
|
"videoId": videoId
|
||||||
|
"title": title
|
||||||
|
"videoThumbnails": videoThumbnails
|
||||||
|
}
|
||||||
|
|
||||||
|
PushFeedItem(video, context)
|
||||||
|
return invalid
|
||||||
|
end function
|
||||||
|
|
||||||
function TileRendererTypePlaylist(nodeData as object, context as object) as object
|
function TileRendererTypePlaylist(nodeData as object, context as object) as object
|
||||||
playlistId = nodeData["contentId"]
|
playlistId = nodeData["contentId"]
|
||||||
if not IsString(playlistId)
|
if not IsString(playlistId)
|
||||||
|
|||||||
Reference in new issue
Block a user