Add a hint to error message when login is required to view video (#652)
* Add a hint to error message when login is required to view video * changelog
This commit is contained in:
1 parent
8051458df7
commit
8e71ededd2
2 files changed
+24
-9
No files matched your search
@@ -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/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Added a "hint" in the error message when playing a video and login is required.
|
||||||
|
|
||||||
## [0.40.2] - 2025-06-12
|
## [0.40.2] - 2025-06-12
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -99,26 +99,35 @@ namespace Innertube
|
|||||||
return "Invalid playability status"
|
return "Invalid playability status"
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if playabilityStatus["status"] = "OK"
|
status = ValidString(playabilityStatus["status"])
|
||||||
|
if status = "OK"
|
||||||
return ""
|
return ""
|
||||||
end if
|
end if
|
||||||
|
|
||||||
errorMessage = ""
|
errorLines = []
|
||||||
if IsString(playabilityStatus["reason"])
|
if not StringUtils.IsNullOrEmpty(playabilityStatus["reason"])
|
||||||
errorMessage = playabilityStatus["reason"]
|
errorLines.Push(playabilityStatus["reason"])
|
||||||
|
end if
|
||||||
|
|
||||||
|
if not StringUtils.IsNullOrEmpty(playabilityStatus["reasonTitle"])
|
||||||
|
errorLines.Push(playabilityStatus["reasonTitle"])
|
||||||
end if
|
end if
|
||||||
|
|
||||||
subreason = ParseText(ObjectUtils.Dig(playabilityStatus, ["errorScreen", "playerErrorMessageRenderer", "subreason"]))
|
subreason = ParseText(ObjectUtils.Dig(playabilityStatus, ["errorScreen", "playerErrorMessageRenderer", "subreason"]))
|
||||||
|
|
||||||
if subreason <> ""
|
if subreason <> ""
|
||||||
errorMessage += `\n` + subreason
|
errorLines.Push(subreason)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if errorMessage = ""
|
if errorLines.Count() = 0
|
||||||
errorMessage = "Video not available"
|
errorLines.Push("Video not available (Unknown)")
|
||||||
end if
|
end if
|
||||||
|
|
||||||
return errorMessage
|
if status = "LOGIN_REQUIRED"
|
||||||
|
' TODO:P2 localize
|
||||||
|
errorLines.Push("Hint: Log in to the YouTube app on your phone, then cast the video to Playlet.")
|
||||||
|
end if
|
||||||
|
|
||||||
|
return errorLines.Join(`\n`)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function ParseStoryboards(payload as object, lengthSeconds as integer) as object
|
function ParseStoryboards(payload as object, lengthSeconds as integer) as object
|
||||||
|
|||||||
Reference in new issue
Block a user