fix: validate AniList reports against version two schema
This commit is contained in:
+5
-1
@@ -40,9 +40,13 @@ struct ZokoCheck {
|
||||
try require(source.title == "AniList 1 · Episode 1 (sub)" && source.subtitles.count == 1 && source.subtitles[0].isDefault,
|
||||
"honest fallback title and VTT metadata")
|
||||
try require(source.headers == ZokoResolver.referer && source.subtitles[0].headers == ZokoResolver.referer, "only fixed public Referer scoped to declared CDN")
|
||||
let semicolonless = try page(config).replacingOccurrences(of: "';</script>", with: "'</script>")
|
||||
let deployedSource = try ZokoResolver.parse(page: semicolonless, mediaID: "1", episode: 1)
|
||||
try require(deployedSource.identity == source.identity, "deployed semicolonless static assignment is accepted")
|
||||
let missing = "<span>// Error</span><span>404</span><h1>Not <span>found.</span></h1><p>We couldn't find anything to play here.</p>"
|
||||
try expect(.unavailable) { _ = try ZokoResolver.parse(page: missing, mediaID: "1", episode: 27) }
|
||||
for protected in ["<title>Just a moment</title>", "<script src='/cdn-cgi/challenge-platform/x'></script>"] {
|
||||
for protected in ["<title>Just a moment</title>", "<script src='/cdn-cgi/challenge-platform/x'></script>",
|
||||
"<h1>Sorry, you have been blocked</h1>"] {
|
||||
try expect(.protection) { _ = try ZokoResolver.parse(page: protected, mediaID: "1", episode: 1) }
|
||||
}
|
||||
for malformed in ["<html></html>", "window.__P='broken';", try page(config) + page(config), String(repeating: "x", count: ZokoResolver.bodyLimit + 1)] {
|
||||
|
||||
Reference in New Issue
Block a user