From ff663b678758aff3faa737fcc800157f3253f365 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sun, 21 Sep 2025 17:17:43 -0400 Subject: [PATCH] Capture missing init-range fields - 2 --- CHANGELOG.md | 6 +++++ .../Services/Innertube/PlayerEndpoint.bs | 22 +++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1283a6ce..9fbcf661 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 + +- Capturing diagnostic events related to playback errors to further investigate + ## [0.41.19] - 2025-09-21 ### Fixed diff --git a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs index 974239be..47b506dc 100644 --- a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs +++ b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs @@ -101,7 +101,7 @@ namespace Innertube hasLiveStreamingData = FormatsHaveLiveStreamingData(adaptiveFormats) or FormatsHaveLiveStreamingData(formats) - adaptiveFormats = TransformFormats(adaptiveFormats, true) + adaptiveFormats = TransformFormats(adaptiveFormats, not hasLiveStreamingData) formats = TransformFormats(formats, false) parsedResponse["type"] = "video" @@ -314,25 +314,25 @@ namespace Innertube analysis = invalid if analyze analysis = { - "noInitRange": [] - "noIndexRange": [] + "issueDetected": false } end if + result = [] for i = 0 to formats.Count() - 1 - formats[i] = TransformFormat(formats[i], analysis) + result.Push(TransformFormat(formats[i], analysis)) end for - ' Are these OTF streams? - if analyze and (analysis["noInitRange"].Count() > 0 or analysis["noIndexRange"].Count() > 0) + if analyze and analysis.issueDetected + ' Are these OTF streams? LogTelemetryEvent({ level: "error" - message: `Some formats are missing initRange or indexRange\nAnalysis: ${ToString(analysis)}\nFormats: ${FormatJson(formats)}` - fingerprint: ["noInitRange-noIndexRange"] + message: `Some formats are missing initRange or indexRange\nFormats: ${FormatJson(formats)}` + fingerprint: ["Some formats are missing initRange or indexRange"] }) end if - return formats + return result end function function TransformFormat(fmt as object, analysis as object) as object @@ -351,7 +351,7 @@ namespace Innertube else result["init"] = "" if analysis <> invalid - analysis["noInitRange"].Push(itag) + analysis.issueDetected = true end if end if if IsAssociativeArray(fmt["indexRange"]) @@ -359,7 +359,7 @@ namespace Innertube else result["index"] = "" if analysis <> invalid - analysis["noIndexRange"].Push(itag) + analysis.issueDetected = true end if end if