Capture missing init-range fields
This commit is contained in:
1 parent
a67080be61
commit
7d217e49de
2 files changed
+32
-6
No files matched your search
+3
-1
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
- Nothing worth mentioning yet.
|
### Fixed
|
||||||
|
|
||||||
|
- Capturing diagnostic events related to playback errors to further investigate
|
||||||
|
|
||||||
## [0.41.18] - 2025-09-20
|
## [0.41.18] - 2025-09-20
|
||||||
|
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ namespace Innertube
|
|||||||
|
|
||||||
hasLiveStreamingData = FormatsHaveLiveStreamingData(adaptiveFormats) or FormatsHaveLiveStreamingData(formats)
|
hasLiveStreamingData = FormatsHaveLiveStreamingData(adaptiveFormats) or FormatsHaveLiveStreamingData(formats)
|
||||||
|
|
||||||
adaptiveFormats = TransformFormats(adaptiveFormats)
|
adaptiveFormats = TransformFormats(adaptiveFormats, true)
|
||||||
formats = TransformFormats(formats)
|
formats = TransformFormats(formats, false)
|
||||||
|
|
||||||
parsedResponse["type"] = "video"
|
parsedResponse["type"] = "video"
|
||||||
parsedResponse["videoId"] = videoDetails["videoId"]
|
parsedResponse["videoId"] = videoDetails["videoId"]
|
||||||
@@ -310,14 +310,32 @@ namespace Innertube
|
|||||||
return captions
|
return captions
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function TransformFormats(formats as object) as object
|
function TransformFormats(formats as object, analyze as boolean) as object
|
||||||
|
analysis = invalid
|
||||||
|
if analyze
|
||||||
|
analysis = {
|
||||||
|
"noInitRange": []
|
||||||
|
"noIndexRange": []
|
||||||
|
}
|
||||||
|
end if
|
||||||
|
|
||||||
for i = 0 to formats.Count() - 1
|
for i = 0 to formats.Count() - 1
|
||||||
formats[i] = TransformFormat(formats[i])
|
formats[i] = TransformFormat(formats[i], analysis)
|
||||||
end for
|
end for
|
||||||
|
|
||||||
|
' Are these OTF streams?
|
||||||
|
if analyze and (analysis["noInitRange"].Count() > 0 or analysis["noIndexRange"].Count() > 0)
|
||||||
|
LogTelemetryEvent({
|
||||||
|
level: "error"
|
||||||
|
message: `Some formats are missing initRange or indexRange\nAnalysis: ${ToString(analysis)}\nFormats: ${FormatJson(formats)}`
|
||||||
|
fingerprint: ["noInitRange-noIndexRange"]
|
||||||
|
})
|
||||||
|
end if
|
||||||
|
|
||||||
return formats
|
return formats
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function TransformFormat(fmt as object) as object
|
function TransformFormat(fmt as object, analysis as object) as object
|
||||||
itag = `${fmt["itag"]}`
|
itag = `${fmt["itag"]}`
|
||||||
result = {
|
result = {
|
||||||
"bitrate": `${fmt["bitrate"]}`
|
"bitrate": `${fmt["bitrate"]}`
|
||||||
@@ -332,11 +350,17 @@ namespace Innertube
|
|||||||
result["init"] = `${fmt["initRange"]["start"]}-${fmt["initRange"]["end"]}`
|
result["init"] = `${fmt["initRange"]["start"]}-${fmt["initRange"]["end"]}`
|
||||||
else
|
else
|
||||||
result["init"] = ""
|
result["init"] = ""
|
||||||
|
if analysis <> invalid
|
||||||
|
analysis["noInitRange"].Push(itag)
|
||||||
|
end if
|
||||||
end if
|
end if
|
||||||
if IsAssociativeArray(fmt["indexRange"])
|
if IsAssociativeArray(fmt["indexRange"])
|
||||||
result["index"] = `${fmt["indexRange"]["start"]}-${fmt["indexRange"]["end"]}`
|
result["index"] = `${fmt["indexRange"]["start"]}-${fmt["indexRange"]["end"]}`
|
||||||
else
|
else
|
||||||
result["index"] = ""
|
result["index"] = ""
|
||||||
|
if analysis <> invalid
|
||||||
|
analysis["noIndexRange"].Push(itag)
|
||||||
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if fmt["audioQuality"] <> invalid
|
if fmt["audioQuality"] <> invalid
|
||||||
|
|||||||
Reference in new issue
Block a user