From 30ea0075028d8fa2e3dc2bfd52548c715fe84986 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sat, 17 May 2025 09:42:19 -0400 Subject: [PATCH] A couple of fixes --- CHANGELOG.md | 1 + .../src/components/Services/Innertube/NodesParser.bs | 7 +++++++ playlet-lib/src/components/VideoPlayer/VideoContentTask.bs | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3c24d16..cabe2178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - A few issues related to Playlet backend feeds and caching +- An error when Invidious doesn't return valid video metadata ## [0.37.0] - 2025-05-16 diff --git a/playlet-lib/src/components/Services/Innertube/NodesParser.bs b/playlet-lib/src/components/Services/Innertube/NodesParser.bs index 33e756e3..2da62d63 100644 --- a/playlet-lib/src/components/Services/Innertube/NodesParser.bs +++ b/playlet-lib/src/components/Services/Innertube/NodesParser.bs @@ -929,6 +929,13 @@ namespace Innertube function ParseTileRenderer(nodeData as object, context as object) as object contentType = ValidString(nodeData["contentType"]) + ' A tileRenderer can be without a contentType, such as a + ' button that says "Open YouTube Kids" or similar CTAs + if contentType = "" + LogWarn(`TileRenderer without contentType:\n`, nodeData) + return invalid + end if + if contentType = "TILE_CONTENT_TYPE_VIDEO" return TileRendererTypeVideo(nodeData, context) else if contentType = "TILE_CONTENT_TYPE_PLAYLIST" diff --git a/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs b/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs index 08662d28..d6e7d6c4 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs @@ -31,6 +31,13 @@ function VideoContentTask(input as object) as object metadata = service.GetVideoMetadata(contentNode.videoId, { cancellation: m.top.cancellation }) end if + if metadata = invalid + return { + success: false + error: "Failed to get video metadata" + } + end if + if m.top.cancel return invalid end if