Fallback for post live dvr and OTF videos
This commit is contained in:
1 parent
dd1cd8db97
commit
777b36852f
3 files changed
+23
-5
No files matched your search
@@ -81,9 +81,9 @@ namespace InnertubeService
|
||||
end if
|
||||
|
||||
playerResponseJson = playerResponse.Json()
|
||||
isLiveOrPostLiveDvr = Innertube.IsLiveStream(playerResponseJson) or Innertube.IsPostLiveDvr(playerResponseJson)
|
||||
if isLiveOrPostLiveDvr and client = Innertube.ClientType.Tv
|
||||
LogDebug("Live video detected, falling back to iOS for HLS streams.")
|
||||
notDashSupported = Innertube.IsLiveStream(playerResponseJson) or Innertube.IsPostLiveDvr(playerResponseJson) or Innertube.IsTypeOTF(playerResponseJson)
|
||||
if notDashSupported and client = Innertube.ClientType.Tv
|
||||
LogDebug("Falling back to iOS client for live/DVR/OTF video.")
|
||||
isLoggedIn = Innertube.ParseIsLoggedIn(playerResponseJson)
|
||||
playbackTrackingUrls = Innertube.ParsePlaybackTrackingUrls(playerResponseJson, isLoggedIn)
|
||||
client = Innertube.ClientType.IOS
|
||||
|
||||
@@ -627,4 +627,22 @@ namespace Innertube
|
||||
|
||||
return false
|
||||
end function
|
||||
|
||||
function IsTypeOTF(payload as object) as boolean
|
||||
return FormatsHasTypeOTF(ObjectUtils.Dig(payload, ["streamingData", "adaptiveFormats"]))
|
||||
end function
|
||||
|
||||
function FormatsHasTypeOTF(formats as object) as boolean
|
||||
if not IsArray(formats)
|
||||
return false
|
||||
end if
|
||||
for each fmt in formats
|
||||
if ValidString(fmt["type"]) = "FORMAT_STREAM_TYPE_OTF"
|
||||
return true
|
||||
end if
|
||||
end for
|
||||
|
||||
return false
|
||||
end function
|
||||
|
||||
end namespace
|
||||
Reference in new issue
Block a user