From f16681adebf515a263edf0898fd76fb17d696c0e Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Mon, 18 Aug 2025 18:25:02 -0400 Subject: [PATCH] Don't decipher urls on live videos --- .../components/Services/Innertube/PlayerEndpoint.bs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs index 39132653..531fa8e9 100644 --- a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs +++ b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs @@ -85,6 +85,7 @@ namespace Innertube end if lengthSeconds = videoDetails["lengthSeconds"].ToInt() + isLive = ValidBool(videoDetails["isLive"]) videoInfo = { "type": "video" @@ -95,10 +96,10 @@ namespace Innertube "author": videoDetails["author"] "authorId": videoDetails["channelId"] "lengthSeconds": lengthSeconds - "liveNow": ValidBool(videoDetails["isLive"]) + "liveNow": isLive "hlsUrl": streamingData["hlsManifestUrl"] "dashUrl": streamingData["dashManifestUrl"] - "adaptiveFormats": ParseAdaptiveFormats(payload, signatureTimestamp, cancellation) + "adaptiveFormats": ParseAdaptiveFormats(payload, signatureTimestamp, isLive, cancellation) "hasDecodedDashUrls": true "formatStreams": [] "captions": ParseCaptions(payload) @@ -288,13 +289,15 @@ namespace Innertube return captions end function - function ParseAdaptiveFormats(payload as object, signatureTimestamp as dynamic, cancellation as object) as object + function ParseAdaptiveFormats(payload as object, signatureTimestamp as dynamic, isLive as boolean, cancellation as object) as object adaptiveFormats = ObjectUtils.Dig(payload, ["streamingData", "adaptiveFormats"]) if not IsArray(adaptiveFormats) return [] end if - adaptiveFormats = DecipherUrls(adaptiveFormats, signatureTimestamp, cancellation) + if not isLive + adaptiveFormats = DecipherUrls(adaptiveFormats, signatureTimestamp, cancellation) + end if formats = [] for each fmt in adaptiveFormats