From 1f069f80c3d4143fe9d141a60e7ea1475c47810b Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Thu, 15 Oct 2026 19:43:16 -0400 Subject: [PATCH] Error message when account requires age verification --- CHANGELOG.md | 4 +- .../Services/Innertube/PlayerEndpoint.bs | 47 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc7e8f86..aa3fd7a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing worth mentioning yet +### Fixed + +- Error message when account requires age verification ## [0.48.9] - 2026-10-14 diff --git a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs index c068a7c3..814a757a 100644 --- a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs +++ b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs @@ -235,7 +235,13 @@ namespace Innertube errorLines.Push(subreason) end if + playerErrorCommand = ObjectUtils.Dig(playabilityStatus, ["errorScreen", "playerErrorCommandRenderer"]) + if IsAssociativeArray(playerErrorCommand) + errorLines.Append(ParsePlayerErrorCommandRenderer(playerErrorCommand)) + end if + if errorLines.Count() = 0 + Warning(`Unparsed playability status: ${status}`, playabilityStatus, { request: playerRequest }) errorLines.Push("Video not available (Unknown)") end if @@ -258,6 +264,47 @@ namespace Innertube return errorLines.Join(`\n`) end function + function ParsePlayerErrorCommandRenderer(renderer as object) as object + lines = [] + errorMessage = ParseText(renderer["errorMessage"]) + if errorMessage <> "" + lines.Push(errorMessage) + end if + lines.Append(ParseOpenPopupAction(ObjectUtils.Dig(renderer, ["command", "openPopupAction"]))) + return lines + end function + + function ParseOpenPopupAction(openPopupAction as object) as object + lines = [] + panel = ObjectUtils.Dig(openPopupAction, ["popup", "overlaySectionRenderer", "overlay", "overlayTwoPanelRenderer", "actionPanel", "overlayPanelRenderer"]) + if not IsAssociativeArray(panel) + return lines + end if + + header = ObjectUtils.Dig(panel, ["header", "overlayPanelHeaderRenderer"]) + title = ParseText(ObjectUtils.Dig(header, ["title"])) + if title <> "" + lines.Push(title) + end if + subtitle = ParseText(ObjectUtils.Dig(header, ["subtitle"])) + if subtitle <> "" + lines.Push(subtitle) + end if + + items = ObjectUtils.Dig(panel, ["content", "overlayPanelItemListRenderer", "items"]) + if not IsArray(items) + return lines + end if + for each item in items + url = ParseText(ObjectUtils.Dig(item, ["secondScreenActionRenderer", "url"])) + if url <> "" + lines.Push(url) + end if + lines.Append(ParseOpenPopupAction(ObjectUtils.Dig(item, ["compactLinkRenderer", "serviceEndpoint", "openPopupAction"]))) + end for + return lines + end function + function PlayerResponseRequiresPageReload(payload as object) as boolean signal = ObjectUtils.Dig(payload, ["playabilityStatus", "errorScreen", "playerErrorMessageRenderer", "proceedButton", "buttonRenderer", "command", "signalAction", "signal"]) return IsString(signal) and signal = "RELOAD_PAGE"