Fix json parsing with invalid chars like \u0000 preventing some channels from loading

This commit is contained in:
Brahim Hadriche committed 2025-11-14 15:47:49 -05:00
1 parent 9a319eab75
commit b5261d900f
27 files changed
+61 -32

No files matched your search

@@ -1,7 +1,7 @@
import "InvidiousService.bs"
function Init()
m.top.apiDefinitions = ParseJson(ReadAsciiFile("libpkg:/config/invidious_video_api.yaml"))
m.top.apiDefinitions = StringUtils.ParseJsonSafe(ReadAsciiFile("libpkg:/config/invidious_video_api.yaml"))
m.service = new Invidious.InvidiousService(m.top)
end function
@@ -698,7 +698,7 @@ namespace Invidious
end function
function VerifyTokenScope(token as string) as boolean
tokenObject = ParseJson(token)
tokenObject = StringUtils.ParseJsonSafe(token)
if tokenObject = invalid
LogWarn("Failed to json parse token:", token)
return false