From bbabb3184df3c4b61982976d24466ea75e1eec3a Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Thu, 18 Jun 2026 17:19:12 -0400 Subject: [PATCH] page reload fix --- CHANGELOG.md | 6 ++++++ .../src/components/Services/Innertube/InnertubeService.bs | 6 ++++++ .../src/components/Services/Innertube/PlayerEndpoint.bs | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0e91cde..05baa041 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ 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/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- Attempt to fix the "The page needs to be reloaded" error by refreshing the signature timestamp automatically + ## [0.47.1] - 2026-06-18 ### Fixed diff --git a/playlet-lib/src/components/Services/Innertube/InnertubeService.bs b/playlet-lib/src/components/Services/Innertube/InnertubeService.bs index 774fa068..bcb11ebe 100644 --- a/playlet-lib/src/components/Services/Innertube/InnertubeService.bs +++ b/playlet-lib/src/components/Services/Innertube/InnertubeService.bs @@ -38,6 +38,7 @@ namespace InnertubeService playerResponseJson = invalid client = Innertube.ClientType.Tv totalPlayerRequests = 0 + triedReloadRefresh = false while true ' We shouldn't be making more than 2 requests: ' 1. Make request with TV client. @@ -86,6 +87,11 @@ namespace InnertubeService if parsedResponse.errorCode = "STS_MISMATCH" LogInfo("STS_MISMATCH error, retrying...") continue while + else if parsedResponse.errorCode = "RELOAD_PAGE" and not triedReloadRefresh + triedReloadRefresh = true + LogInfo("RELOAD_PAGE: clearing stale STS cache and retrying...") + DeleteFile("tmp:/sts_cache.json") + continue while else if parsedResponse.errorCode = "MISSING_FORMAT_FIELD" useServerDrivenAbr = `${ObjectUtils.Dig(playerResponseJson, ["playerConfig", "mediaCommonConfig", "useServerDrivenAbr"])}` LogTelemetryEvent({ diff --git a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs index 68320e54..24334ef3 100644 --- a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs +++ b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs @@ -77,6 +77,9 @@ namespace Innertube error = ParsePlayerResponseForError(payload, playerRequest) if error <> "" parsedResponse["error"] = error + if PlayerResponseRequiresPageReload(payload) + parsedResponse["errorCode"] = "RELOAD_PAGE" + end if return parsedResponse end if @@ -231,6 +234,11 @@ namespace Innertube return errorLines.Join(`\n`) 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" + end function + function ParseStoryboards(payload as object, lengthSeconds as integer) as object storyboard = ObjectUtils.Dig(payload, ["storyboards", "playerLiveStoryboardSpecRenderer", "spec"]) if IsString(storyboard)