adjust live video detection to reduce error rate happening on iOS client
This commit is contained in:
1 parent
e389772e87
commit
55e65c42a6
4 files changed
+22
-5
No files matched your search
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Bug in dash storyboard
|
- Bug in dash storyboard
|
||||||
|
- Adjust live video detection to reduce error rate happening on iOS client
|
||||||
|
|
||||||
## [0.41.8] - 2025-09-07
|
## [0.41.8] - 2025-09-07
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ namespace InnertubeService
|
|||||||
' # Start of iOS fallback
|
' # Start of iOS fallback
|
||||||
playbackTrackingUrls = invalid
|
playbackTrackingUrls = invalid
|
||||||
responseJson = playerResponse.Json()
|
responseJson = playerResponse.Json()
|
||||||
if ValidBool(ObjectUtils.Dig(responseJson, ["videoDetails", "isLive"])) or ValidBool(ObjectUtils.Dig(responseJson, ["videoDetails", "isLiveContent"]))
|
if ValidBool(ObjectUtils.Dig(responseJson, ["videoDetails", "isLive"])) or ValidBool(ObjectUtils.Dig(responseJson, ["videoDetails", "hasLiveStreamingData"]))
|
||||||
LogDebug("Live video detected, falling back to iOS for HLS streams.")
|
LogDebug("Live video detected, falling back to iOS for HLS streams.")
|
||||||
isLoggedIn = Innertube.ParseIsLoggedIn(responseJson)
|
isLoggedIn = Innertube.ParseIsLoggedIn(responseJson)
|
||||||
playbackTrackingUrls = Innertube.ParsePlaybackTrackingUrls(responseJson, isLoggedIn)
|
playbackTrackingUrls = Innertube.ParsePlaybackTrackingUrls(responseJson, isLoggedIn)
|
||||||
|
|||||||
@@ -86,7 +86,8 @@ namespace Innertube
|
|||||||
|
|
||||||
lengthSeconds = videoDetails["lengthSeconds"].ToInt()
|
lengthSeconds = videoDetails["lengthSeconds"].ToInt()
|
||||||
isLive = ValidBool(videoDetails["isLive"])
|
isLive = ValidBool(videoDetails["isLive"])
|
||||||
isLiveContent = ValidBool(videoDetails["isLiveContent"])
|
adaptiveFormats = ParseAdaptiveFormats(payload, signatureTimestamp, isLive, cancellation)
|
||||||
|
hasLiveStreamingData = FormatsHaveLiveStreamingData(adaptiveFormats)
|
||||||
|
|
||||||
videoInfo = {
|
videoInfo = {
|
||||||
"type": "video"
|
"type": "video"
|
||||||
@@ -98,10 +99,10 @@ namespace Innertube
|
|||||||
"authorId": videoDetails["channelId"]
|
"authorId": videoDetails["channelId"]
|
||||||
"lengthSeconds": lengthSeconds
|
"lengthSeconds": lengthSeconds
|
||||||
"liveNow": isLive
|
"liveNow": isLive
|
||||||
"isLiveContent": isLiveContent
|
"hasLiveStreamingData": hasLiveStreamingData
|
||||||
"hlsUrl": streamingData["hlsManifestUrl"]
|
"hlsUrl": streamingData["hlsManifestUrl"]
|
||||||
"dashUrl": streamingData["dashManifestUrl"]
|
"dashUrl": streamingData["dashManifestUrl"]
|
||||||
"adaptiveFormats": ParseAdaptiveFormats(payload, signatureTimestamp, isLive or isLiveContent, cancellation)
|
"adaptiveFormats": adaptiveFormats
|
||||||
"formatStreams": []
|
"formatStreams": []
|
||||||
"captions": ParseCaptions(payload)
|
"captions": ParseCaptions(payload)
|
||||||
"recommendedVideos": []
|
"recommendedVideos": []
|
||||||
@@ -510,4 +511,19 @@ namespace Innertube
|
|||||||
"videostatsWatchtimeUrl": ObjectUtils.Dig(playbackTracking, ["videostatsWatchtimeUrl", "baseUrl"])
|
"videostatsWatchtimeUrl": ObjectUtils.Dig(playbackTracking, ["videostatsWatchtimeUrl", "baseUrl"])
|
||||||
}
|
}
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function FormatsHaveLiveStreamingData(adaptiveFormats as object) as boolean
|
||||||
|
if not IsArray(adaptiveFormats)
|
||||||
|
return false
|
||||||
|
end if
|
||||||
|
|
||||||
|
for each fmt in adaptiveFormats
|
||||||
|
url = fmt["url"]
|
||||||
|
if IsString(url) and url.InStr("yt_live_broadcast") <> -1
|
||||||
|
return true
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
|
||||||
|
return false
|
||||||
|
end function
|
||||||
end namespace
|
end namespace
|
||||||
@@ -122,7 +122,7 @@ namespace Http
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
' TODO:P2: handle live videos
|
' TODO:P2: handle live videos
|
||||||
if ValidBool(metadata.liveNow) or ValidBool(metadata.isLiveContent)
|
if ValidBool(metadata.liveNow) or ValidBool(metadata.hasLiveStreamingData)
|
||||||
return hlsManifest
|
return hlsManifest
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user