Capture dash on video errors
This commit is contained in:
1 parent
f0d516d194
commit
63cf9a5e56
3 files changed
+28
-10
No files matched your search
@@ -17,6 +17,8 @@ function ExecuteJob() as void
|
|||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
DeleteFile("tmp:/last_generated_dash.xml")
|
||||||
|
|
||||||
if StringUtils.IsNullOrEmpty(contentNode.videoId)
|
if StringUtils.IsNullOrEmpty(contentNode.videoId)
|
||||||
JobError("Can't load video information: videoId is missing")
|
JobError("Can't load video information: videoId is missing")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -447,11 +447,7 @@ function OnVideoPlayerStateChange() as void
|
|||||||
errorData = GetPlayerErrorData(content.videoId, errorInfo)
|
errorData = GetPlayerErrorData(content.videoId, errorInfo)
|
||||||
|
|
||||||
LogErrorNoTelemetry(errorData.title, errorData.body)
|
LogErrorNoTelemetry(errorData.title, errorData.body)
|
||||||
m.global.telemetry.LogEvent = {
|
ReportVideoError(errorData)
|
||||||
level: "error"
|
|
||||||
message: errorData.title + " " + errorData.body
|
|
||||||
fingerprint: errorData.fingerprint
|
|
||||||
}
|
|
||||||
errorReported = true
|
errorReported = true
|
||||||
|
|
||||||
if m.videoPlayingSuccess <> true
|
if m.videoPlayingSuccess <> true
|
||||||
@@ -503,11 +499,7 @@ function OnVideoPlayerStateChange() as void
|
|||||||
|
|
||||||
LogErrorNoTelemetry(errorData.title, errorData.body)
|
LogErrorNoTelemetry(errorData.title, errorData.body)
|
||||||
if not errorReported
|
if not errorReported
|
||||||
m.global.telemetry.LogEvent = {
|
ReportVideoError(errorData)
|
||||||
level: "error"
|
|
||||||
message: errorData.title + " " + errorData.body
|
|
||||||
fingerprint: errorData.fingerprint
|
|
||||||
}
|
|
||||||
end if
|
end if
|
||||||
|
|
||||||
buttons = [Tr(Locale.Buttons.PlayNextVideo), Tr(Locale.Buttons.Cancel)]
|
buttons = [Tr(Locale.Buttons.PlayNextVideo), Tr(Locale.Buttons.Cancel)]
|
||||||
@@ -555,6 +547,28 @@ function GetPlayerErrorData(videoId as string, errorInfo as object) as object
|
|||||||
}
|
}
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function ReportVideoError(errorData as object) as void
|
||||||
|
attachments = invalid
|
||||||
|
if errorData.body.Instr("malformed data") <> -1 or errorData.body.Instr("invalid pathname") <> -1
|
||||||
|
lastGeneratedDash = ReadAsciiFile("tmp:/last_generated_dash.xml")
|
||||||
|
if not StringUtils.IsNullOrEmpty(lastGeneratedDash)
|
||||||
|
attachments = [{
|
||||||
|
filename: "last_generated_dash.xml"
|
||||||
|
content_type: "application/dash+xml"
|
||||||
|
data: lastGeneratedDash
|
||||||
|
}]
|
||||||
|
DeleteFile("tmp:/last_generated_dash.xml")
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
|
||||||
|
m.global.telemetry.LogEvent = {
|
||||||
|
level: "error"
|
||||||
|
message: errorData.title + " " + errorData.body
|
||||||
|
fingerprint: errorData.fingerprint
|
||||||
|
attachments: attachments
|
||||||
|
}
|
||||||
|
end function
|
||||||
|
|
||||||
function OnVideoFinished() as void
|
function OnVideoFinished() as void
|
||||||
if not VideoQueueUtils.PlayNext(m.videoQueue, m.invidious, m.preferences)
|
if not VideoQueueUtils.PlayNext(m.videoQueue, m.invidious, m.preferences)
|
||||||
m.videoQueue.closePlayer = true
|
m.videoQueue.closePlayer = true
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ namespace Http
|
|||||||
response.SetBodyDataString(xmlContent)
|
response.SetBodyDataString(xmlContent)
|
||||||
response.ContentType("application/dash+xml")
|
response.ContentType("application/dash+xml")
|
||||||
|
|
||||||
|
WriteAsciiFile("tmp:/last_generated_dash.xml", xmlContent)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user